diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-03-07 01:50:10 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-03-07 01:50:10 +0000 |
commit | c14bc77315ac4867f16c1585181b41919339eb3c (patch) | |
tree | a5613a37365664d1bf1f6352f4e7fea7c0b4893b /test/Transforms/InstCombine/icmp.ll | |
parent | 128ccbb8e5e142d4ec6c9afb4160b74f76cb3064 (diff) | |
download | llvm-c14bc77315ac4867f16c1585181b41919339eb3c.tar.gz llvm-c14bc77315ac4867f16c1585181b41919339eb3c.tar.bz2 llvm-c14bc77315ac4867f16c1585181b41919339eb3c.tar.xz |
Add more analysis of the sign bit of an srem instruction. If the LHS is negative
then the result could go either way. If it's provably positive then so is the
srem. Fixes PR9343 #7!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/icmp.ll')
-rw-r--r-- | test/Transforms/InstCombine/icmp.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index 63f76313f8..bf0107adf0 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -475,3 +475,22 @@ entry: %cmp = icmp ult <2 x i32> %tmp11, <i32 4, i32 4> ret <2 x i1> %cmp } + +; PR9343 #7 +; CHECK: @test50 +; CHECK: ret i1 true +define i1 @test50(i16 %X, i32 %Y) { + %A = zext i16 %X to i32 + %B = srem i32 %A, %Y + %C = icmp sgt i32 %B, -1 + ret i1 %C +} + +; CHECK: @test51 +; CHECK: ret i1 %C +define i1 @test51(i16 %X, i32 %Y) { + %A = sext i16 %X to i32 + %B = srem i32 %A, %Y + %C = icmp sgt i32 %B, -1 + ret i1 %C +} |