From a2b7720618b7cadb6e8dd07941261a0bf6837986 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Fri, 31 May 2013 00:59:42 +0000 Subject: Reapply with r182909 with a fix to the calculation of the new indices for insertelement instructions. llvm-svn: 182976 --- llvm/test/Transforms/InstCombine/vec_shuffle.ll | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'llvm/test/Transforms') diff --git a/llvm/test/Transforms/InstCombine/vec_shuffle.ll b/llvm/test/Transforms/InstCombine/vec_shuffle.ll index 8f78c2e6bd5..4b7a049baec 100644 --- a/llvm/test/Transforms/InstCombine/vec_shuffle.ll +++ b/llvm/test/Transforms/InstCombine/vec_shuffle.ll @@ -153,3 +153,24 @@ define <8 x i8> @test12a(<8 x i8> %tmp6, <8 x i8> %tmp2) nounwind { ret <8 x i8> %tmp3 } +define <2 x i8> @test13a(i8 %x1, i8 %x2) { +; CHECK: @test13a +; CHECK-NEXT: insertelement {{.*}} undef, i8 %x1, i32 1 +; CHECK-NEXT: insertelement {{.*}} i8 %x2, i32 0 +; CHECK-NEXT: add {{.*}} +; CHECK-NEXT: ret + %A = insertelement <2 x i8> undef, i8 %x1, i32 0 + %B = insertelement <2 x i8> %A, i8 %x2, i32 1 + %C = add <2 x i8> %B, + %D = shufflevector <2 x i8> %C, <2 x i8> undef, <2 x i32> + ret <2 x i8> %D +} + +define <2 x i8> @test13b(i8 %x) { +; CHECK: @test13b +; CHECK-NEXT: insertelement <2 x i8> undef, i8 %x, i32 1 +; CHECK-NEXT: ret + %A = insertelement <2 x i8> undef, i8 %x, i32 0 + %B = shufflevector <2 x i8> %A, <2 x i8> undef, <2 x i32> + ret <2 x i8> %B +} -- cgit v1.2.3