summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/sext.ll
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-02 14:32:58 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-02 14:32:58 +0000
commit82899febf07aa2cc42761102f92609a804034ba2 (patch)
tree41b9b3784dd055041d9cbb630bf6d509255dc2db /llvm/test/Transforms/InstCombine/sext.ll
parentcbee13e04c9f7070681a66cc2d26faa86927d83c (diff)
downloadbcm5719-llvm-82899febf07aa2cc42761102f92609a804034ba2.tar.gz
bcm5719-llvm-82899febf07aa2cc42761102f92609a804034ba2.zip
Add the nsw flag when we detect that an add will not signed overflow.
We already had a function for checking this, we were just using it only in specialized cases. llvm-svn: 210029
Diffstat (limited to 'llvm/test/Transforms/InstCombine/sext.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/sext.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/sext.ll b/llvm/test/Transforms/InstCombine/sext.ll
index b8dfe2257b1..f04afcc747b 100644
--- a/llvm/test/Transforms/InstCombine/sext.ll
+++ b/llvm/test/Transforms/InstCombine/sext.ll
@@ -145,7 +145,7 @@ define i32 @test13(i32 %x) nounwind {
; CHECK-LABEL: @test13(
; CHECK-NEXT: %and = lshr i32 %x, 3
; CHECK-NEXT: %1 = and i32 %and, 1
-; CHECK-NEXT: %sext = add i32 %1, -1
+; CHECK-NEXT: %sext = add nsw i32 %1, -1
; CHECK-NEXT: ret i32 %sext
}
@@ -157,7 +157,7 @@ define i32 @test14(i16 %x) nounwind {
; CHECK-LABEL: @test14(
; CHECK-NEXT: %and = lshr i16 %x, 4
; CHECK-NEXT: %1 = and i16 %and, 1
-; CHECK-NEXT: %sext = add i16 %1, -1
+; CHECK-NEXT: %sext = add nsw i16 %1, -1
; CHECK-NEXT: %ext = sext i16 %sext to i32
; CHECK-NEXT: ret i32 %ext
}
OpenPOWER on IntegriCloud