diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-03-05 05:19:11 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-03-05 05:19:11 +0000 |
commit | 58bfcdbcf6a7c1cac0187f7c6beb3afe9d8f5411 (patch) | |
tree | 55ed7acb7e70c544307c139b9d20b4e49aac4146 /test/Transforms/InstSimplify | |
parent | 9feda1730c225589e144fb1f86a86a8cf3f39c9e (diff) | |
download | external_llvm-58bfcdbcf6a7c1cac0187f7c6beb3afe9d8f5411.zip external_llvm-58bfcdbcf6a7c1cac0187f7c6beb3afe9d8f5411.tar.gz external_llvm-58bfcdbcf6a7c1cac0187f7c6beb3afe9d8f5411.tar.bz2 |
Thread comparisons over udiv/sdiv/ashr/lshr exact and lshr nuw/nsw whenever
possible. This goes into instcombine and instsimplify because instsimplify
doesn't need to check hasOneUse since it returns (almost exclusively) constants.
This fixes PR9343 #4 #5 and #8!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstSimplify')
-rw-r--r-- | test/Transforms/InstSimplify/compare.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll index 7b92de15..7174e7f 100644 --- a/test/Transforms/InstSimplify/compare.ll +++ b/test/Transforms/InstSimplify/compare.ll @@ -261,6 +261,15 @@ define i1 @udiv1(i32 %X) { ; CHECK: ret i1 true } +define i1 @udiv2(i32 %X, i32 %Y, i32 %Z) { +; CHECK: @udiv2 + %A = udiv exact i32 10, %Z + %B = udiv exact i32 20, %Z + %C = icmp ult i32 %A, %B + ret i1 %C +; CHECK: ret i1 true +} + define i1 @sdiv1(i32 %X) { ; CHECK: @sdiv1 %A = sdiv i32 %X, 1000000 |