[llvm-commits] [llvm] r53062 - /llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
Devang Patel
dpatel at apple.com
Wed Jul 2 17:08:13 PDT 2008
Author: dpatel
Date: Wed Jul 2 19:08:13 2008
New Revision: 53062
URL: http://llvm.org/viewvc/llvm-project?rev=53062&view=rev
Log:
Undo previous patch. It is not that simple to fix dom info here.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=53062&r1=53061&r2=53062&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Wed Jul 2 19:08:13 2008
@@ -1204,32 +1204,18 @@
// trying to update it is complicated. So instead we preserve the
// loop structure and put the block on an dead code path.
- BasicBlock *SISucc = SI->getSuccessor(i);
BasicBlock* Old = SI->getParent();
BasicBlock* Split = SplitBlock(Old, SI, this);
Instruction* OldTerm = Old->getTerminator();
- BranchInst::Create(Split, SISucc,
+ BranchInst::Create(Split, SI->getSuccessor(i),
ConstantInt::getTrue(), OldTerm);
- if (DT) {
- // Now, SISucc is dominated by Old.
- DT->changeImmediateDominator(SISucc, Old);
- if (DF) {
- // Now, Split does not dominate SISucc.
- // SISucc is the only member in Split's DF.
- DominanceFrontier::iterator S_DFI = DF->find(Split);
- if (S_DFI != DF->end())
- S_DFI->second.clear();
- addBBToDomFrontier(*DF, S_DFI, Split, SISucc);
- }
- }
-
LPM->deleteSimpleAnalysisValue(Old->getTerminator(), L);
Old->getTerminator()->eraseFromParent();
PHINode *PN;
- for (BasicBlock::iterator II = SISucc->begin();
+ for (BasicBlock::iterator II = SI->getSuccessor(i)->begin();
(PN = dyn_cast<PHINode>(II)); ++II) {
Value *InVal = PN->removeIncomingValue(Split, false);
PN->addIncoming(InVal, Old);
More information about the llvm-commits
mailing list