diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-07-29 00:18:19 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-07-29 00:18:19 +0000 |
commit | ef715972423a57febb7aa9b056d9bf6320e74817 (patch) | |
tree | baa84e0c8bf0e09f65fc0647ad0550e8402b0ead /test | |
parent | ac03e736c77bcf7e8deb515fc16a7e55d343dc8d (diff) | |
download | external_llvm-ef715972423a57febb7aa9b056d9bf6320e74817.zip external_llvm-ef715972423a57febb7aa9b056d9bf6320e74817.tar.gz external_llvm-ef715972423a57febb7aa9b056d9bf6320e74817.tar.bz2 |
Make sure to correctly clear the exact/nuw/nsw flags off of shifts when they are combined together. <rdar://problem/9859829>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/shift.ll | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test/Transforms/InstCombine/shift.ll b/test/Transforms/InstCombine/shift.ll index d9ac9cb..132d51a 100644 --- a/test/Transforms/InstCombine/shift.ll +++ b/test/Transforms/InstCombine/shift.ll @@ -525,5 +525,20 @@ define i32 @test43(i32 %a, i32 %b) nounwind { ; CHECK-NEXT: ret } - - +define i32 @test44(i32 %a) nounwind { + %y = shl nuw i32 %a, 1 + %z = shl i32 %y, 4 + ret i32 %z +; CHECK: @test44 +; CHECK-NEXT: %y = shl i32 %a, 5 +; CHECK-NEXT: ret i32 %y +} + +define i32 @test45(i32 %a) nounwind { + %y = lshr exact i32 %a, 1 + %z = lshr i32 %y, 4 + ret i32 %z +; CHECK: @test45 +; CHECK-NEXT: %y = lshr i32 %a, 5 +; CHECK-NEXT: ret i32 %y +} |