diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-02-28 06:20:05 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-02-28 06:20:05 +0000 |
commit | d8d1584c13c554349c235177b2b89cb5117347b2 (patch) | |
tree | 4c069c07cae5b491a410bcb1e4e96f96b70d8c7d /test/Transforms/InstCombine | |
parent | ec58f20df31d228de9e4ce54140df356a2bc24c1 (diff) | |
download | external_llvm-d8d1584c13c554349c235177b2b89cb5117347b2.zip external_llvm-d8d1584c13c554349c235177b2b89cb5117347b2.tar.gz external_llvm-d8d1584c13c554349c235177b2b89cb5117347b2.tar.bz2 |
The sign of an srem instruction is the sign of its dividend (the first
argument), regardless of the divisor. Teach instcombine about this and fix
test7 in PR9343!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine')
-rw-r--r-- | test/Transforms/InstCombine/icmp.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index 3150883..c11dea5 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -377,3 +377,13 @@ define i1 @test38(i32 %x, i32 %y, i32 %z) { %c = icmp ugt i32 %lhs, %rhs ret i1 %c } + +; PR9343 #7 +; CHECK: @test39 +; CHECK: ret i1 false +define i1 @test39(i31 %X, i32 %Y) { + %A = zext i31 %X to i32 + %B = srem i32 %A, %Y + %C = icmp slt i32 %B, 0 + ret i1 %C +} |