diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-02-28 08:31:40 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-02-28 08:31:40 +0000 |
commit | b042f8e9699dd15d7ac48bb9b9475122b1673687 (patch) | |
tree | b4f6931415cb55575b9c575ecf700f970dc7ee2b /test/Transforms/InstCombine/icmp.ll | |
parent | 3dfd98744c1f6e6c5d13e419b63ac69894ae84cf (diff) | |
download | llvm-b042f8e9699dd15d7ac48bb9b9475122b1673687.tar.gz llvm-b042f8e9699dd15d7ac48bb9b9475122b1673687.tar.bz2 llvm-b042f8e9699dd15d7ac48bb9b9475122b1673687.tar.xz |
Teach InstCombine to fold "(shr exact X, Y) == 0" --> X == 0, fixing #1 from
PR9343.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/icmp.ll')
-rw-r--r-- | test/Transforms/InstCombine/icmp.ll | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index c11dea5b8f..f6a18faeb3 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -387,3 +387,20 @@ define i1 @test39(i31 %X, i32 %Y) { %C = icmp slt i32 %B, 0 ret i1 %C } + +; PR9343 #1 +; CHECK: test40 +; CHECK %B = icmp eq i32 %X, 0 +define i1 @test40(i32 %X, i32 %Y) { + %A = ashr exact i32 %X, %Y + %B = icmp eq i32 %A, 0 + ret i1 %B +} + +; CHECK: test41 +; CHECK %B = icmp ne i32 %X, 0 +define i1 @test41(i32 %X, i32 %Y) { + %A = lshr exact i32 %X, %Y + %B = icmp ne i32 %A, 0 + ret i1 %B +} |