summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-03-11 09:00:19 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-03-11 09:00:19 +0000
commitb69050a94c1c9266ab048a79c8375e5b14d87c72 (patch)
treebf7c5218182894c05403125a704ce60ba3aa5b18 /test
parent6fd2472b1b2d8f6a64b38874cbca95d3578e16a4 (diff)
downloadllvm-b69050a94c1c9266ab048a79c8375e5b14d87c72.tar.gz
llvm-b69050a94c1c9266ab048a79c8375e5b14d87c72.tar.bz2
llvm-b69050a94c1c9266ab048a79c8375e5b14d87c72.tar.xz
Teach ComputeMaskedBits about nsw on add. I don't think there's anything we can
do with nuw here, but sub and mul should be given similar treatment. Fixes PR9343 #15! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstSimplify/compare.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll
index b5146ee740..75a36b499e 100644
--- a/test/Transforms/InstSimplify/compare.ll
+++ b/test/Transforms/InstSimplify/compare.ll
@@ -261,6 +261,16 @@ define i1 @srem1(i32 %X) {
; CHECK: ret i1 false
}
+; PR9343 #15
+; CHECK: @srem2
+; CHECK: ret i1 false
+define i1 @srem2(i16 %X, i32 %Y) {
+ %A = zext i16 %X to i32
+ %B = add nsw i32 %A, 1
+ %C = srem i32 %B, %Y
+ %D = icmp slt i32 %C, 0
+ ret i1 %D
+}
define i1 @udiv1(i32 %X) {
; CHECK: @udiv1
%A = udiv i32 %X, 1000000