1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-27 14:02:50 +01:00
llvm-mirror/lib/Transforms/InstCombine
Bill Schmidt 5def9d253a [PPC64LE] Correct vperm -> shuffle transform for little endian
As discussed in cfe commit r210279, the correct little-endian
semantics for the vec_perm Altivec interfaces are implemented by
reversing the order of the input vectors and complementing the permute
control vector.  This converts the desired permute from little endian
element order into the big endian element order that the underlying
PowerPC vperm instruction uses.  This is represented with a
ppc_altivec_vperm intrinsic function.

The instruction combining pass contains code to convert a
ppc_altivec_vperm intrinsic into a vector shuffle operation when the
intrinsic has a permute control vector (mask) that is a constant.
However, the vector shuffle operation assumes that vector elements are
in natural order for their endianness, so for little endian code we
will get the wrong result with the existing transformation.

This patch reverses the semantic change to vec_perm that was performed
in altivec.h by once again swapping the input operands and
complementing the permute control vector, returning the element
ordering to little endian.

The correctness of this code is tested by the new perm.c test added in
a previous patch, and by other tests in the test suite that fail
without this patch.

llvm-svn: 210282
2014-06-05 19:46:04 +00:00
..
CMakeLists.txt Tidy up a bit. No functional change. 2013-04-05 21:20:12 +00:00
InstCombine.h Rename ComputeMaskedBits to computeKnownBits. "Masked" has been 2014-05-14 21:14:37 +00:00
InstCombineAddSub.cpp InstCombine: Improvement to check if signed addition overflows. 2014-06-04 15:39:14 +00:00
InstCombineAndOrXor.cpp Reorder shuffle and binary operation. 2014-05-11 08:46:12 +00:00
InstCombineCalls.cpp [PPC64LE] Correct vperm -> shuffle transform for little endian 2014-06-05 19:46:04 +00:00
InstCombineCasts.cpp Rename ComputeMaskedBits to computeKnownBits. "Masked" has been 2014-05-14 21:14:37 +00:00
InstCombineCompares.cpp Added support to optimize comparisons with "lshr exact" of a constant. 2014-06-02 19:19:04 +00:00
InstCombineLoadStoreAlloca.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
InstCombineMulDivRem.cpp Optimize integral reciprocal (udiv 1, x and sdiv 1, x) to not use division. This fires exactly once in a clang bootstrap, but covers a few different results from http://www.cs.utah.edu/~regehr/souper/ 2014-05-14 03:03:05 +00:00
InstCombinePHI.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
InstCombineSelect.cpp Added inst combine transforms for single bit tests from Chris's note 2014-06-02 07:24:36 +00:00
InstCombineShifts.cpp Reorder shuffle and binary operation. 2014-05-11 08:46:12 +00:00
InstCombineSimplifyDemanded.cpp Rename ComputeMaskedBits to computeKnownBits. "Masked" has been 2014-05-14 21:14:37 +00:00
InstCombineVectorOps.cpp Fix type of shuffle resulted from shuffle merge. 2014-05-13 06:07:21 +00:00
InstCombineWorklist.h [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
InstructionCombining.cpp Add a Constant version of stripPointerCasts. 2014-06-04 19:01:48 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile