diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-08 21:50:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-08 21:50:26 +0000 |
commit | 6745191070503f669b07bc14cd6f7e518bd4d5b0 (patch) | |
tree | 5afeb2bbf1b18c6edcbf2c110169b1353dbdb388 /test/Transforms/InstCombine/cast.ll | |
parent | 7944c21cae06c5124cf1ee1f811d2a13f8e1b939 (diff) | |
download | llvm-6745191070503f669b07bc14cd6f7e518bd4d5b0.tar.gz llvm-6745191070503f669b07bc14cd6f7e518bd4d5b0.tar.bz2 llvm-6745191070503f669b07bc14cd6f7e518bd4d5b0.tar.xz |
Teach instcombine to transform a bitcast/(zext|trunc)/bitcast sequence
with a vector input and output into a shuffle vector. This sort of
sequence happens when the input code stores with one type and reloads
with another type and then SROA promotes to i96 integers, which make
everyone sad.
This fixes rdar://7896024
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/cast.ll')
-rw-r--r-- | test/Transforms/InstCombine/cast.ll | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll index 878da6894f..77fccdfa52 100644 --- a/test/Transforms/InstCombine/cast.ll +++ b/test/Transforms/InstCombine/cast.ll @@ -605,3 +605,36 @@ define i64 @test59(i8 %A, i8 %B) nounwind { ; CHECK-NOT: i32 ; CHECK: ret i64 %H } + +define <3 x i32> @test60(<4 x i32> %call4) nounwind { + %tmp11 = bitcast <4 x i32> %call4 to i128 + %tmp9 = trunc i128 %tmp11 to i96 + %tmp10 = bitcast i96 %tmp9 to <3 x i32> + ret <3 x i32> %tmp10 + +; CHECK: @test60 +; CHECK-NEXT: shufflevector +; CHECK-NEXT: ret +} + +define <4 x i32> @test61(<3 x i32> %call4) nounwind { + %tmp11 = bitcast <3 x i32> %call4 to i96 + %tmp9 = zext i96 %tmp11 to i128 + %tmp10 = bitcast i128 %tmp9 to <4 x i32> + ret <4 x i32> %tmp10 +; CHECK: @test61 +; CHECK-NEXT: shufflevector +; CHECK-NEXT: ret +} + +define <4 x i32> @test62(<3 x float> %call4) nounwind { + %tmp11 = bitcast <3 x float> %call4 to i96 + %tmp9 = zext i96 %tmp11 to i128 + %tmp10 = bitcast i128 %tmp9 to <4 x i32> + ret <4 x i32> %tmp10 +; CHECK: @test62 +; CHECK-NEXT: bitcast +; CHECK-NEXT: shufflevector +; CHECK-NEXT: ret +} + |