diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/LoopPass.cpp | 7 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LoopIndexSplit.cpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index c4ff988944..08c25f4cea 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/lib/Analysis/LoopPass.cpp @@ -152,6 +152,13 @@ void LPPassManager::cloneBasicBlockSimpleAnalysis(BasicBlock *From, /// deleteSimpleAnalysisValue - Invoke deleteAnalysisValue hook for all passes. void LPPassManager::deleteSimpleAnalysisValue(Value *V, Loop *L) { + if (BasicBlock *BB = dyn_cast<BasicBlock>(V)) { + for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; + ++BI) { + Instruction &I = *BI; + deleteSimpleAnalysisValue(&I, L); + } + } for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { Pass *P = getContainedPass(Index); LoopPass *LP = dynamic_cast<LoopPass *>(P); diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index e93d448cc1..98e5cc15d6 100644 --- a/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp @@ -673,6 +673,7 @@ void LoopIndexSplit::removeBlocks(BasicBlock *DeadBB, Loop *LP, while (!WorkList.empty()) { BasicBlock *BB = WorkList.back(); WorkList.pop_back(); + LPM->deleteSimpleAnalysisValue(BB, LP); for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end(); BBI != BBE; ) { Instruction *I = BBI; @@ -680,7 +681,6 @@ void LoopIndexSplit::removeBlocks(BasicBlock *DeadBB, Loop *LP, I->replaceAllUsesWith(UndefValue::get(I->getType())); I->eraseFromParent(); } - LPM->deleteSimpleAnalysisValue(BB, LP); DT->eraseNode(BB); DF->removeBlock(BB); LI->removeBlock(BB); |