mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Manually notify ScalarEvolution before making an operand replacement, since
it can't currently observe such changes automatically. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100186 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -510,6 +510,13 @@ void IndVarSimplify::RewriteIVExpressions(Loop *L, SCEVExpander &Rewriter) {
|
||||
// Now expand it into actual Instructions and patch it into place.
|
||||
Value *NewVal = Rewriter.expandCodeFor(AR, UseTy, InsertPt);
|
||||
|
||||
// Inform ScalarEvolution that this value is changing. The change doesn't
|
||||
// affect its value, but it does potentially affect which use lists the
|
||||
// value will be on after the replacement, which affects ScalarEvolution's
|
||||
// ability to walk use lists and drop dangling pointers when a value is
|
||||
// deleted.
|
||||
SE->forgetValue(User);
|
||||
|
||||
// Patch the new value into place.
|
||||
if (Op->hasName())
|
||||
NewVal->takeName(Op);
|
||||
|
||||
Reference in New Issue
Block a user