diff options
author | Justin Bogner <mail@justinbogner.com> | 2013-09-27 20:35:39 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2013-09-27 20:35:39 +0000 |
commit | 5053537a301ee268d3e49f8cf0426f0c536be4e3 (patch) | |
tree | 79c354ab853a4d4b3fc4c5efe23df8df81942396 /test/Transforms | |
parent | 200a7434f6abc1e469fdf1ee547bc3fe4fbfcc02 (diff) | |
download | external_llvm-5053537a301ee268d3e49f8cf0426f0c536be4e3.zip external_llvm-5053537a301ee268d3e49f8cf0426f0c536be4e3.tar.gz external_llvm-5053537a301ee268d3e49f8cf0426f0c536be4e3.tar.bz2 |
InstCombine: Only foldSelectICmpAndOr for integer types
Currently foldSelectICmpAndOr asserts if the "or" involves a vector
containing several of the same power of two. We can easily avoid this by
only performing the fold on integer types, like foldSelectICmpAnd does.
Fixes <rdar://problem/15012516>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/select.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/select.ll b/test/Transforms/InstCombine/select.ll index c7809f7..1458bde 100644 --- a/test/Transforms/InstCombine/select.ll +++ b/test/Transforms/InstCombine/select.ll @@ -986,6 +986,16 @@ define i32 @select_icmp_ne_0_and_8_or_1073741824(i8 %x, i32 %y) { ret i32 %select } +; We can't combine here, because the cmp is scalar and the or vector. +; Just make sure we don't assert. +define <2 x i32> @select_icmp_eq_and_1_0_or_vector_of_2s(i32 %x, <2 x i32> %y) { + %and = and i32 %x, 1 + %cmp = icmp eq i32 %and, 0 + %or = or <2 x i32> %y, <i32 2, i32 2> + %select = select i1 %cmp, <2 x i32> %y, <2 x i32> %or + ret <2 x i32> %select +} + define i32 @test65(i64 %x) { %1 = and i64 %x, 16 %2 = icmp ne i64 %1, 0 |