[ARM] - Fix lowering of shufflevectors in AArch32
authorLuke Cheeseman <luke.cheeseman@arm.com>
Fri, 24 Jul 2015 09:57:05 +0000 (09:57 +0000)
committerLuke Cheeseman <luke.cheeseman@arm.com>
Fri, 24 Jul 2015 09:57:05 +0000 (09:57 +0000)
commit67b17f9ff89dcaea75802bf0d1186f4e6f189602
treedc53ebcc5bb588d007447a61beba8272eadee8cd
parentca2a3eb2e71b782045a4e48f1a26e709b43db2ff
[ARM] - Fix lowering of shufflevectors in AArch32

Some shufflevectors are currently being incorrectly lowered in the AArch32
backend as the existing checks for detecting the NEON operations from the
shufflevector instruction expects the shuffle mask and the vector operands to be
of the same length.

This is not always the case as the mask may be twice as long as the operand;
here only the lower half of the shufflemask gets checked, so provided the lower
half of the shufflemask looks like a vector transpose (or even is just all -1
for undef) then the intrinsics may get incorrectly lowered into a vector
transpose (VTRN) instruction.

This patch fixes this by accommodating for both cases and adds regression tests.

Differential Revision: http://reviews.llvm.org/D11407

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243103 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/vext.ll
test/CodeGen/ARM/vtrn.ll
test/CodeGen/ARM/vuzp.ll
test/CodeGen/ARM/vzip.ll