summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/IndVarSimplify/overflowcheck.ll
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-02-23 23:22:58 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-02-23 23:22:58 +0000
commit18c243b933740506b3262e56ef6f9a3a6e4afc08 (patch)
treec7bf17f52b360208c3f47dda7953cc30201128e0 /llvm/test/Transforms/IndVarSimplify/overflowcheck.ll
parentc9cf0151cf73ed44dd3af74568a9c01d0bded8b9 (diff)
downloadbcm5719-llvm-18c243b933740506b3262e56ef6f9a3a6e4afc08.tar.gz
bcm5719-llvm-18c243b933740506b3262e56ef6f9a3a6e4afc08.zip
Bugfix: SCEVExpander incorrectly marks increment operations as no-wrap
When emitting the increment operation, SCEVExpander marks the operation as nuw or nsw based on the flags on the preincrement SCEV. This is incorrect because, for instance, it is possible that {-6,+,1} is <nuw> while {-6,+,1}+1 = {-5,+,1} is not. This change teaches SCEV to mark the increment as nuw/nsw only if it can explicitly prove that the increment operation won't overflow. Apart from the attached test case, another (more realistic) manifestation of the bug can be seen in Transforms/IndVarSimplify/pr20680.ll. NOTE: this change was landed with an incorrect commit message in rL230275 and was reverted for that reason in rL230279. This commit message is the correct one. Differential Revision: http://reviews.llvm.org/D7778 llvm-svn: 230280
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify/overflowcheck.ll')
-rw-r--r--llvm/test/Transforms/IndVarSimplify/overflowcheck.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/overflowcheck.ll b/llvm/test/Transforms/IndVarSimplify/overflowcheck.ll
index 2603f363ab6..3864c6c0cfb 100644
--- a/llvm/test/Transforms/IndVarSimplify/overflowcheck.ll
+++ b/llvm/test/Transforms/IndVarSimplify/overflowcheck.ll
@@ -9,7 +9,7 @@ target triple = "x86_64-apple-macosx"
; CHECK: @llvm.sadd.with.overflow
; CHECK-LABEL: loop2:
; CHECK-NOT: extractvalue
-; CHECK: add nuw nsw
+; CHECK: add nuw
; CHECK: @llvm.sadd.with.overflow
; CHECK-LABEL: loop3:
; CHECK-NOT: extractvalue
OpenPOWER on IntegriCloud