LoopUnroll: always check for NULL LoopPassManager

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick 2012-06-05 17:51:05 +00:00
parent 9a314da581
commit 1247376856

View File

@ -95,9 +95,11 @@ static BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB, LoopInfo* LI,
// Erase basic block from the function...
// ScalarEvolution holds references to loop exit blocks.
if (ScalarEvolution *SE = LPM->getAnalysisIfAvailable<ScalarEvolution>()) {
if (Loop *L = LI->getLoopFor(BB))
SE->forgetLoop(L);
if (LPM) {
if (ScalarEvolution *SE = LPM->getAnalysisIfAvailable<ScalarEvolution>()) {
if (Loop *L = LI->getLoopFor(BB))
SE->forgetLoop(L);
}
}
LI->removeBlock(BB);
BB->eraseFromParent();