[llvm-commits] [llvm] r41054 - /llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Devang Patel
dpatel at apple.com
Mon Aug 13 15:22:13 PDT 2007
Author: dpatel
Date: Mon Aug 13 17:22:13 2007
New Revision: 41054
URL: http://llvm.org/viewvc/llvm-project?rev=41054&view=rev
Log:
Preserve simple analysis.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=41054&r1=41053&r2=41054&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon Aug 13 17:22:13 2007
@@ -98,7 +98,7 @@
bool safeExitBlock(SplitInfo &SD, BasicBlock *BB);
/// removeBlocks - Remove basic block BB and all blocks dominated by BB.
- void removeBlocks(BasicBlock *InBB);
+ void removeBlocks(BasicBlock *InBB, Loop *LP);
/// Find cost of spliting loop L.
unsigned findSplitCost(Loop *L, SplitInfo &SD);
@@ -589,7 +589,7 @@
}
/// removeBlocks - Remove basic block BB and all blocks dominated by BB.
-void LoopIndexSplit::removeBlocks(BasicBlock *InBB) {
+void LoopIndexSplit::removeBlocks(BasicBlock *InBB, Loop *LP) {
SmallVector<std::pair<BasicBlock *, succ_iterator>, 8> WorkList;
WorkList.push_back(std::make_pair(InBB, succ_begin(InBB)));
@@ -606,6 +606,7 @@
I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->eraseFromParent();
}
+ LPM->deleteSimpleAnalysisValue(BB, LP);
DT->eraseNode(BB);
DF->removeBlock(BB);
LI->removeBlock(BB);
@@ -719,7 +720,7 @@
BranchInst *BR = cast<BranchInst>(SplitBlock->getTerminator());
BasicBlock *FBB = BR->getSuccessor(1);
BR->setUnconditionalDest(BR->getSuccessor(0));
- removeBlocks(FBB);
+ removeBlocks(FBB, L);
//[*] Update True loop's exit value using new exit value.
ExitCondition->setOperand(ExitValueNum, TLExitValue);
@@ -729,7 +730,7 @@
BranchInst *FBR = cast<BranchInst>(FSplitBlock->getTerminator());
BasicBlock *TBB = FBR->getSuccessor(0);
FBR->setUnconditionalDest(FBR->getSuccessor(1));
- removeBlocks(TBB);
+ removeBlocks(TBB, FalseLoop);
return true;
}
More information about the llvm-commits
mailing list