diff options
author | Pete Cooper <peter_cooper@apple.com> | 2012-07-26 23:10:24 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2012-07-26 23:10:24 +0000 |
commit | 7971de4178d3be9b31ac03c20e2b50c3e7f4641c (patch) | |
tree | 20b1ab3b863df8ea2eb884c38c019552b1a387a2 /test/Transforms | |
parent | 3ba90d9c0ec6c669174431ff6b4f504a582559c4 (diff) | |
download | external_llvm-7971de4178d3be9b31ac03c20e2b50c3e7f4641c.zip external_llvm-7971de4178d3be9b31ac03c20e2b50c3e7f4641c.tar.gz external_llvm-7971de4178d3be9b31ac03c20e2b50c3e7f4641c.tar.bz2 |
Simplify demanded bits of select sources where the condition is a constant vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160835 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/vec_demanded_elts.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/vec_demanded_elts.ll b/test/Transforms/InstCombine/vec_demanded_elts.ll index d904196..0019a57 100644 --- a/test/Transforms/InstCombine/vec_demanded_elts.ll +++ b/test/Transforms/InstCombine/vec_demanded_elts.ll @@ -190,4 +190,23 @@ define <2 x double> @test_fpext(float %f) { ret <2 x double> %ret } +define <4 x float> @test_select(float %f, float %g) { +; CHECK: @test_select +; CHECK: %a0 = insertelement <4 x float> undef, float %f, i32 0 +; CHECK-NOT: insertelement +; CHECK: %a3 = insertelement <4 x float> %a0, float 3.000000e+00, i32 3 +; CHECK-NOT: insertelement +; CHECK: %ret = select <4 x i1> <i1 true, i1 false, i1 false, i1 true>, <4 x float> %a3, <4 x float> <float undef, float 4.000000e+00, float 5.000000e+00, float undef> + %a0 = insertelement <4 x float> undef, float %f, i32 0 + %a1 = insertelement <4 x float> %a0, float 1.000000e+00, i32 1 + %a2 = insertelement <4 x float> %a1, float 2.000000e+00, i32 2 + %a3 = insertelement <4 x float> %a2, float 3.000000e+00, i32 3 + %b0 = insertelement <4 x float> undef, float %g, i32 0 + %b1 = insertelement <4 x float> %b0, float 4.000000e+00, i32 1 + %b2 = insertelement <4 x float> %b1, float 5.000000e+00, i32 2 + %b3 = insertelement <4 x float> %b2, float 6.000000e+00, i32 3 + %ret = select <4 x i1> <i1 true, i1 false, i1 false, i1 true>, <4 x float> %a3, <4 x float> %b3 + ret <4 x float> %ret +} + |