[SCEVExpander][PowerPC]clear scev rewriter before deleting instructions.

Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D85130
This commit is contained in:
Chen Zheng 2020-08-03 08:37:52 -04:00
parent 675ad1bc6a
commit ba955397ac
1 changed files with 4 additions and 0 deletions

View File

@ -606,6 +606,10 @@ bool PPCLoopInstrFormPrep::rewriteLoadStores(Loop *L, Bucket &BucketChain,
NewBasePtr = NewPHI; 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)) if (Instruction *IDel = dyn_cast<Instruction>(BasePtr))
BBChanged.insert(IDel->getParent()); BBChanged.insert(IDel->getParent());
BasePtr->replaceAllUsesWith(NewBasePtr); BasePtr->replaceAllUsesWith(NewBasePtr);