aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-03-01 08:15:50 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-03-01 08:15:50 +0000
commit88cd0aadb2849a259e8656b0ff8439ef660db7c5 (patch)
tree6ce65a7ae0c7f343cf249c72ef2150feca450042 /test
parent9d40193d79052fb4ddd0f667f0fe47f07922c72a (diff)
Optimize "icmp pred (urem X, Y), Y" --> true/false depending on pred. There's
more work to do here, "icmp ult (urem X, 10), 11" doesn't optimize away yet. Fixes example 3 from PR9343! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstSimplify/compare.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll
index 250e44ce34..f392d3a5e7 100644
--- a/test/Transforms/InstSimplify/compare.ll
+++ b/test/Transforms/InstSimplify/compare.ll
@@ -187,3 +187,19 @@ define i1 @select4(i1 %cond) {
ret i1 %c
; CHECK: ret i1 %cond
}
+
+define i1 @urem1(i32 %X, i32 %Y) {
+; CHECK: @urem1
+ %A = urem i32 %X, %Y
+ %B = icmp ult i32 %A, %Y
+ ret i1 %B
+; CHECK: ret i1 true
+}
+
+define i1 @urem2(i32 %X, i32 %Y) {
+; CHECK: @urem2
+ %A = urem i32 %X, %Y
+ %B = icmp eq i32 %A, %Y
+ ret i1 %B
+; CHECK ret i1 false
+}