summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/icmp.ll
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-01-11 00:36:45 +0000
committerOwen Anderson <resistor@mac.com>2011-01-11 00:36:45 +0000
commitda1c122da5e1a86c8c2bf20e47a43f5c8fefc4e2 (patch)
treeba0ea2ae5721d9e2aad293f7da32c13844e71ec9 /test/Transforms/InstCombine/icmp.ll
parent93c70426f581859f197df1b05fdb1b3664d361a0 (diff)
downloadllvm-da1c122da5e1a86c8c2bf20e47a43f5c8fefc4e2.tar.gz
llvm-da1c122da5e1a86c8c2bf20e47a43f5c8fefc4e2.tar.bz2
llvm-da1c122da5e1a86c8c2bf20e47a43f5c8fefc4e2.tar.xz
Fix a random missed optimization by making InstCombine more aggressive when determining which bits are demanded by
a comparison against a constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/icmp.ll')
-rw-r--r--test/Transforms/InstCombine/icmp.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll
index e33463dbe5..8a0b8ff93b 100644
--- a/test/Transforms/InstCombine/icmp.ll
+++ b/test/Transforms/InstCombine/icmp.ll
@@ -192,3 +192,20 @@ define i1 @test20(i32 %x) nounwind {
; CHECK-NEXT: %cmp = icmp eq i32 %x, 3
}
+define i1 @test21(i8 %x, i8 %y) {
+; CHECK: @test21
+; CHECK-NOT: or i8
+; CHECK: icmp ugt
+ %A = or i8 %x, 1
+ %B = icmp ugt i8 %A, 3
+ ret i1 %B
+}
+
+define i1 @test22(i8 %x, i8 %y) {
+; CHECK: @test22
+; CHECK-NOT: or i8
+; CHECK: icmp ult
+ %A = or i8 %x, 1
+ %B = icmp ult i8 %A, 4
+ ret i1 %B
+}