[SCEVExpander][PowerPC]clear scev rewriter before deleting instructions.
authorChen Zheng <czhengsz@cn.ibm.com>
Mon, 3 Aug 2020 12:37:52 +0000 (08:37 -0400)
committerChen Zheng <czhengsz@cn.ibm.com>
Tue, 4 Aug 2020 00:36:08 +0000 (20:36 -0400)
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D85130

llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp

index a7546d2..0068ad7 100644 (file)
@@ -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);