diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-03-04 10:06:52 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-03-04 10:06:52 +0000 |
commit | 8e3a79da9f6e0b9f6c98f154d6ff2be8e66fc530 (patch) | |
tree | 1f8c95c55b0dd6d337b24c5fc9a772d84ea7c1ac /llvm/test/Transforms/InstCombine/icmp.ll | |
parent | 74186ab391c8e82b58efd015ae7fd91c322355ed (diff) | |
download | bcm5719-llvm-8e3a79da9f6e0b9f6c98f154d6ff2be8e66fc530.tar.gz bcm5719-llvm-8e3a79da9f6e0b9f6c98f154d6ff2be8e66fc530.zip |
Fold "icmp pred (srem X, Y), Y" like we do for urem. Handle signed comparisons
in the urem case, though not the other way around. This is enough to get #3 from
PR9343!
llvm-svn: 126991
Diffstat (limited to 'llvm/test/Transforms/InstCombine/icmp.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/icmp.ll | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll index ff11bbff77c..fba273550b1 100644 --- a/llvm/test/Transforms/InstCombine/icmp.ll +++ b/llvm/test/Transforms/InstCombine/icmp.ll @@ -379,7 +379,7 @@ define i1 @test38(i32 %x, i32 %y, i32 %z) { } ; PR9343 #1 -; CHECK: test39 +; CHECK: @test39 ; CHECK %B = icmp eq i32 %X, 0 define i1 @test39(i32 %X, i32 %Y) { %A = ashr exact i32 %X, %Y @@ -387,10 +387,19 @@ define i1 @test39(i32 %X, i32 %Y) { ret i1 %B } -; CHECK: test40 +; CHECK: @test40 ; CHECK: %B = icmp ne i32 %X, 0 define i1 @test40(i32 %X, i32 %Y) { %A = lshr exact i32 %X, %Y %B = icmp ne i32 %A, 0 ret i1 %B } + +; PR9343 #3 +; CHECK: @test41 +; CHECK: ret i1 true +define i1 @test41(i32 %X, i32 %Y) { + %A = urem i32 %X, %Y + %B = icmp ugt i32 %Y, %A + ret i1 %B +} |