diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-09-01 21:56:00 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-09-01 21:56:00 +0000 |
commit | 699a9dd7c3d217f16c7dd0e6ea53738f7754ba6a (patch) | |
tree | 7cf4e6834e30bcfe4ebbae5b2b9cf4c1327f637b /llvm/test/CodeGen/ARM/vdup.ll | |
parent | ee1364f7f69d15309c9ffe44551ea9e0e77046a5 (diff) | |
download | bcm5719-llvm-699a9dd7c3d217f16c7dd0e6ea53738f7754ba6a.tar.gz bcm5719-llvm-699a9dd7c3d217f16c7dd0e6ea53738f7754ba6a.zip |
[ARM] Don't abort on variable-idx extractelt in ReconstructShuffle.
The code introduced in r244314 assumed that EXTRACT_VECTOR_ELT only
takes constant indices, but it does accept variables.
Bail out for those: we can't use them, as the shuffles we want to
reconstruct do require constant masks.
llvm-svn: 246594
Diffstat (limited to 'llvm/test/CodeGen/ARM/vdup.ll')
-rw-r--r-- | llvm/test/CodeGen/ARM/vdup.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/vdup.ll b/llvm/test/CodeGen/ARM/vdup.ll index 36eebbfc465..25c4807d986 100644 --- a/llvm/test/CodeGen/ARM/vdup.ll +++ b/llvm/test/CodeGen/ARM/vdup.ll @@ -364,3 +364,19 @@ define <4 x float> @check_spr_splat4_lane1(<4 x float> %p, i16 %q) { %sub = fsub <4 x float> %splat.splat, %p ret <4 x float> %sub } + +; Also make sure we don't barf on variable-index extractelts, where we almost +; could have generated a vdup. + +define <8 x i8> @check_i8_varidx(<16 x i8> %v, i32 %idx) { +; CHECK-LABEL: check_i8_varidx: +; CHECK: mov r[[FP:[0-9]+]], sp +; CHECK: ldr r[[IDX:[0-9]+]], [r[[FP]], #4] +; CHECK: mov r[[SPCOPY:[0-9]+]], sp +; CHECK: vst1.64 {d{{.*}}, d{{.*}}}, [r[[SPCOPY]]:128], r[[IDX]] +; CHECK: vld1.8 {d{{.*}}[]}, [r[[SPCOPY]]] + %x = extractelement <16 x i8> %v, i32 %idx + %1 = insertelement <8 x i8> undef, i8 %x, i32 0 + %2 = insertelement <8 x i8> %1, i8 %x, i32 1 + ret <8 x i8> %2 +} |