aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/vec_demanded_elts.ll
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2012-07-26 22:37:04 +0000
committerPete Cooper <peter_cooper@apple.com>2012-07-26 22:37:04 +0000
commit1121c786fc24a4a8ce6c778cb9b5acdfa9006ffb (patch)
treef3441bbcbcb0ebc8c0afcaa7ccea734e26b98433 /test/Transforms/InstCombine/vec_demanded_elts.ll
parent79ad138a3341f2ac8121208db6559438b13b5a69 (diff)
Teach SimplifyDemandedBits how to look through fpext and fptrunc to simplify their operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/vec_demanded_elts.ll')
-rw-r--r--test/Transforms/InstCombine/vec_demanded_elts.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/vec_demanded_elts.ll b/test/Transforms/InstCombine/vec_demanded_elts.ll
index cc63371ede..d904196d13 100644
--- a/test/Transforms/InstCombine/vec_demanded_elts.ll
+++ b/test/Transforms/InstCombine/vec_demanded_elts.ll
@@ -162,4 +162,32 @@ entry:
ret <4 x float> %shuffle9.i
}
+define <2 x float> @test_fptrunc(double %f) {
+; CHECK: @test_fptrunc
+; CHECK: insertelement
+; CHECK: insertelement
+; CHECK-NOT: insertelement
+ %tmp9 = insertelement <4 x double> undef, double %f, i32 0
+ %tmp10 = insertelement <4 x double> %tmp9, double 0.000000e+00, i32 1
+ %tmp11 = insertelement <4 x double> %tmp10, double 0.000000e+00, i32 2
+ %tmp12 = insertelement <4 x double> %tmp11, double 0.000000e+00, i32 3
+ %tmp5 = fptrunc <4 x double> %tmp12 to <4 x float>
+ %ret = shufflevector <4 x float> %tmp5, <4 x float> undef, <2 x i32> <i32 0, i32 1>
+ ret <2 x float> %ret
+}
+
+define <2 x double> @test_fpext(float %f) {
+; CHECK: @test_fpext
+; CHECK: insertelement
+; CHECK: insertelement
+; CHECK-NOT: insertelement
+ %tmp9 = insertelement <4 x float> undef, float %f, i32 0
+ %tmp10 = insertelement <4 x float> %tmp9, float 0.000000e+00, i32 1
+ %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2
+ %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, i32 3
+ %tmp5 = fpext <4 x float> %tmp12 to <4 x double>
+ %ret = shufflevector <4 x double> %tmp5, <4 x double> undef, <2 x i32> <i32 0, i32 1>
+ ret <2 x double> %ret
+}
+