summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/load-cmp.ll
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-04-14 21:15:43 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-04-14 21:15:43 +0000
commit024d943bca85ee0b6bc1b9e5f13ec5276f16c13d (patch)
tree81479f985b66d217409d4160a4d0d47effb2b85c /test/Transforms/InstCombine/load-cmp.ll
parent687a9dfcb9a5f39e3252b2bd8d83642be02dc235 (diff)
downloadllvm-024d943bca85ee0b6bc1b9e5f13ec5276f16c13d.tar.gz
llvm-024d943bca85ee0b6bc1b9e5f13ec5276f16c13d.tar.bz2
llvm-024d943bca85ee0b6bc1b9e5f13ec5276f16c13d.tar.xz
Reorders two transforms that collide with each other
One performs: (X == 13 | X == 14) -> X-13 <u 2 The other: (A == C1 || A == C2) -> (A & ~(C1 ^ C2)) == C1 The problem is that there are certain values of C1 and C2 that trigger both transforms but the first one blocks out the second, this generates suboptimal code. Reordering the transforms should be better in every case and allows us to do interesting stuff like turn: %shr = lshr i32 %X, 4 %and = and i32 %shr, 15 %add = add i32 %and, -14 %tobool = icmp ne i32 %add, 0 into: %and = and i32 %X, 240 %tobool = icmp ne i32 %and, 224 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/load-cmp.ll')
-rw-r--r--test/Transforms/InstCombine/load-cmp.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/Transforms/InstCombine/load-cmp.ll b/test/Transforms/InstCombine/load-cmp.ll
index d88188e410..869215cb58 100644
--- a/test/Transforms/InstCombine/load-cmp.ll
+++ b/test/Transforms/InstCombine/load-cmp.ll
@@ -100,8 +100,8 @@ define i1 @test8(i32 %X) {
%S = icmp eq i16 %R, 0
ret i1 %S
; CHECK: @test8
-; CHECK-NEXT: add i32 %X, -8
-; CHECK-NEXT: icmp ult i32 {{.*}}, 2
+; CHECK-NEXT: and i32 %X, -2
+; CHECK-NEXT: icmp eq i32 {{.*}}, 8
; CHECK-NEXT: ret i1
}