Skip to content

Commit

Permalink
[SCEVExpander][PowerPC]clear scev rewriter before deleting instructions.
Browse files Browse the repository at this point in the history
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D85130
  • Loading branch information
chenzheng1030 committed Aug 4, 2020
1 parent 675ad1b commit ba95539
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ bool PPCLoopInstrFormPrep::rewriteLoadStores(Loop *L, Bucket &BucketChain,
NewBasePtr = NewPHI;
}

// Clear the rewriter cache, because values that are in the rewriter's cache
// can be deleted below, causing the AssertingVH in the cache to trigger.
SCEVE.clear();

if (Instruction *IDel = dyn_cast<Instruction>(BasePtr))
BBChanged.insert(IDel->getParent());
BasePtr->replaceAllUsesWith(NewBasePtr);
Expand Down

0 comments on commit ba95539

Please sign in to comment.