diff options
| author | Dan Gohman <gohman@apple.com> | 2010-02-18 23:26:33 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-02-18 23:26:33 +0000 |
| commit | 9bd170bd0f0938db215dfd8e8fa87555352454e7 (patch) | |
| tree | a8b39fb2b0d7b3248227a27ac9c24db838ac7567 /lib/Transforms | |
| parent | 98a4640f12b89049e6fa8308a976a65dc1cc251f (diff) | |
| download | external_llvm-9bd170bd0f0938db215dfd8e8fa87555352454e7.zip external_llvm-9bd170bd0f0938db215dfd8e8fa87555352454e7.tar.gz external_llvm-9bd170bd0f0938db215dfd8e8fa87555352454e7.tar.bz2 | |
Indvars needs to explicitly notify ScalarEvolution when it is replacing
a loop exit value, so that if a loop gets deleted, ScalarEvolution
isn't stick holding on to dangling SCEVAddRecExprs for that loop. This
fixes PR6339.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96626 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
| -rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index e699261..60492b0 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 |
