summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/ScalarEvolution
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-11-06 02:02:05 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-11-06 02:02:05 +0000
commite059f4452b270bcf75a343effd4ca4e0ed05b518 (patch)
tree06c547bb8427d40369e486daa93b57ffe3e19f53 /llvm/test/Analysis/ScalarEvolution
parent6c7073f2f8007a6bb1d992eb68a2eaadd7f4529e (diff)
downloadbcm5719-llvm-e059f4452b270bcf75a343effd4ca4e0ed05b518.tar.gz
bcm5719-llvm-e059f4452b270bcf75a343effd4ca4e0ed05b518.zip
Revert "[IndVars] Smart hard uses detection"
This reverts commit 2f425e9c7946b9d74e64ebbfa33c1caa36914402. It seems that the check that we still should do the transform if we know the result is constant is missing in this code. So the logic that has been deleted by this change is still sometimes accidentally useful. I revert the change to see what can be done about it. The motivating case is the following: @Y = global [400 x i16] zeroinitializer, align 1 define i16 @foo() { entry: br label %for.body for.body: ; preds = %entry, %for.body %i = phi i16 [ 0, %entry ], [ %inc, %for.body ] %arrayidx = getelementptr inbounds [400 x i16], [400 x i16]* @Y, i16 0, i16 %i store i16 0, i16* %arrayidx, align 1 %inc = add nuw nsw i16 %i, 1 %cmp = icmp ult i16 %inc, 400 br i1 %cmp, label %for.body, label %for.end for.end: ; preds = %for.body %inc.lcssa = phi i16 [ %inc, %for.body ] ret i16 %inc.lcssa } We should be able to figure out that the result is constant, but the patch breaks it. Differential Revision: https://reviews.llvm.org/D51584 llvm-svn: 346198
Diffstat (limited to 'llvm/test/Analysis/ScalarEvolution')
-rw-r--r--llvm/test/Analysis/ScalarEvolution/pr28705.ll6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/Analysis/ScalarEvolution/pr28705.ll b/llvm/test/Analysis/ScalarEvolution/pr28705.ll
index 9a8487a6c66..8fbc08e3ca6 100644
--- a/llvm/test/Analysis/ScalarEvolution/pr28705.ll
+++ b/llvm/test/Analysis/ScalarEvolution/pr28705.ll
@@ -1,11 +1,11 @@
; PR28705
; RUN: opt < %s -indvars -S | FileCheck %s
-; Check IndVarSimplify doesn't replace external use of the induction var
-; "%inc.i.i" with "%.sroa.speculated + 1" because it is not profitable.
+; Check IndVarSimplify replaces the exitval use of the induction var "%inc.i.i"
+; with "%.sroa.speculated + 1".
;
; CHECK-LABEL: @foo(
-; CHECK: %[[EXIT:.+]] = phi i32 [ %inc.i.i, %for.body650 ]
+; CHECK: %[[EXIT:.+]] = sub i32 %.sroa.speculated, -1
; CHECK: %DB.sroa.9.0.lcssa = phi i32 [ 1, %entry ], [ %[[EXIT]], %loopexit ]
;
define void @foo(i32 %sub.ptr.div.i, i8* %ref.i1174) local_unnamed_addr {
OpenPOWER on IntegriCloud