mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user