aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstSimplify/compare.ll
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-03-12 17:18:11 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-03-12 17:18:11 +0000
commit14b2a59301e9e4065c7b9b07a0c68462b6037a4f (patch)
tree24e22757d901ffa8e83af49a47da3746e6333b75 /test/Transforms/InstSimplify/compare.ll
parent879d3a98a2d64793a49e747b3d64020db74c5a3e (diff)
Teach ComputeMaskedBits about sub nsw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127548 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstSimplify/compare.ll')
-rw-r--r--test/Transforms/InstSimplify/compare.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll
index 75a36b499e..d2c564f567 100644
--- a/test/Transforms/InstSimplify/compare.ll
+++ b/test/Transforms/InstSimplify/compare.ll
@@ -271,6 +271,29 @@ define i1 @srem2(i16 %X, i32 %Y) {
%D = icmp slt i32 %C, 0
ret i1 %D
}
+
+; CHECK: @srem3
+; CHECK-NEXT: ret i1 false
+define i1 @srem3(i16 %X, i32 %Y) {
+ %A = zext i16 %X to i32
+ %B = or i32 2147483648, %A
+ %C = sub nsw i32 1, %B
+ %D = srem i32 %C, %Y
+ %E = icmp slt i32 %D, 0
+ ret i1 %E
+}
+
+; CHECK: @srem4
+; CHECK-NEXT: ret i1 false
+define i1 @srem4(i16 %X, i32 %Y) {
+ %A = zext i16 %X to i32
+ %B = or i32 2147483648, %A
+ %C = sub nsw i32 %A, %B
+ %D = srem i32 %C, %Y
+ %E = icmp slt i32 %D, 0
+ ret i1 %E
+}
+
define i1 @udiv1(i32 %X) {
; CHECK: @udiv1
%A = udiv i32 %X, 1000000