summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/ScalarEvolution/pr28705.ll
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-11-01 06:47:01 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-11-01 06:47:01 +0000
commit3d347bf545d51156b3c1bf6ed93100369568a550 (patch)
tree6345424779cffca969eda3fe6f73518cd2a26fc8 /llvm/test/Analysis/ScalarEvolution/pr28705.ll
parente0a2613aeaae93bf75ccc6c616fec3c45147a3df (diff)
downloadbcm5719-llvm-3d347bf545d51156b3c1bf6ed93100369568a550.tar.gz
bcm5719-llvm-3d347bf545d51156b3c1bf6ed93100369568a550.zip
[IndVars] Smart hard uses detection
When rewriting loop exit values, IndVars considers this transform not profitable if the loop instruction has a loop user which it believes cannot be optimized away. In current implementation only calls that immediately use the instruction are considered as such. This patch extends the definition of "hard" users to any side-effecting instructions (which usually cannot be optimized away from the loop) and also allows handling of not just immediate users, but use chains. Differentlai Revision: https://reviews.llvm.org/D51584 Reviewed By: etherzhhb llvm-svn: 345814
Diffstat (limited to 'llvm/test/Analysis/ScalarEvolution/pr28705.ll')
-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 8fbc08e3ca6..9a8487a6c66 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 replaces the exitval use of the induction var "%inc.i.i"
-; with "%.sroa.speculated + 1".
+; Check IndVarSimplify doesn't replace external use of the induction var
+; "%inc.i.i" with "%.sroa.speculated + 1" because it is not profitable.
;
; CHECK-LABEL: @foo(
-; CHECK: %[[EXIT:.+]] = sub i32 %.sroa.speculated, -1
+; CHECK: %[[EXIT:.+]] = phi i32 [ %inc.i.i, %for.body650 ]
; 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