diff options
author | Jakub Staszak <kubastaszak@gmail.com> | 2012-12-31 00:34:55 +0000 |
---|---|---|
committer | Jakub Staszak <kubastaszak@gmail.com> | 2012-12-31 00:34:55 +0000 |
commit | d60b8ac64fa161646d50c49d6171cb49e6a2c7ee (patch) | |
tree | 96b9e6304e1c6187584c90a8124206f1608929e0 /test/Transforms/InstCombine/icmp.ll | |
parent | 6eb7a4270bc411342f459bc574f8fe4ef5eeff28 (diff) | |
download | external_llvm-d60b8ac64fa161646d50c49d6171cb49e6a2c7ee.zip external_llvm-d60b8ac64fa161646d50c49d6171cb49e6a2c7ee.tar.gz external_llvm-d60b8ac64fa161646d50c49d6171cb49e6a2c7ee.tar.bz2 |
Transform (A == C1 || A == C2) into (A & ~(C1 ^ C2)) == C1
if C1 and C2 differ only with one bit.
Fixes PR14708.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/icmp.ll')
-rw-r--r-- | test/Transforms/InstCombine/icmp.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index 138b10e..5102a9c 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -694,3 +694,14 @@ define i1 @test68(i32 %x) nounwind uwtable { %cmp = icmp sgt i32 %and, 30 ret i1 %cmp } + +; PR14708 +; CHECK: @test69 +; CHECK: %1 = and i32 %c, -33 +; CHECK: %2 = icmp eq i32 %1, 65 +define i1 @test69(i32 %c) nounwind uwtable { + %1 = icmp eq i32 %c, 97 + %2 = icmp eq i32 %c, 65 + %3 = or i1 %1, %2 + ret i1 %3 +} |