From 45a2d7d44ae697e28df383d31455145fb754ac58 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 19 Feb 2010 07:14:22 +0000 Subject: recommit 96626, evidence that it broke things appears to be spurious git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96662 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/IndVarSimplify.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Transforms') diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index e699261b27..60492b0283 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -246,6 +246,13 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L, if (!PN->getType()->isIntegerTy() && !PN->getType()->isPointerTy()) continue; + // It's necessary to tell ScalarEvolution about this explicitly so that + // it can walk the def-use list and forget all SCEVs, as it may not be + // watching the PHI itself. Once the new exit value is in place, there + // may not be a def-use connection between the loop and every instruction + // which got a SCEVAddRecExpr for that loop. + SE->forgetValue(PN); + // Iterate over all of the values in all the PHI nodes. for (unsigned i = 0; i != NumPreds; ++i) { // If the value being merged in is not integer or is not defined -- cgit v1.2.3-70-g09d2