[llvm-commits] [llvm] r53531 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Chris Lattner
sabre at nondot.org
Sun Jul 13 14:55:47 PDT 2008
Author: lattner
Date: Sun Jul 13 16:55:46 2008
New Revision: 53531
URL: http://llvm.org/viewvc/llvm-project?rev=53531&view=rev
Log:
improve comments.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=53531&r1=53530&r2=53531&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Sun Jul 13 16:55:46 2008
@@ -1538,6 +1538,9 @@
PHINode *NewPN = PHINode::Create(Type::Int1Ty,
BI->getCondition()->getName() + ".pr",
BB->begin());
+ // Okay, we're going to insert the PHI node. Since PBI is not the only
+ // predecessor, compute the PHI'd conditional value for all of the preds.
+ // Any predecessor where the condition is not computable we keep symbolic.
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
if ((PBI = dyn_cast<BranchInst>((*PI)->getTerminator())) &&
PBI != BI && PBI->isConditional() &&
@@ -1551,7 +1554,6 @@
}
BI->setCondition(NewPN);
- // This will thread the branch.
return true;
}
}
@@ -1653,7 +1655,7 @@
// them agree.
for (BasicBlock::iterator II = CommonDest->begin();
(PN = dyn_cast<PHINode>(II)); ++II) {
- Value * BIV = PN->getIncomingValueForBlock(BB);
+ Value *BIV = PN->getIncomingValueForBlock(BB);
unsigned PBBIdx = PN->getBasicBlockIndex(PBI->getParent());
Value *PBIV = PN->getIncomingValue(PBBIdx);
if (BIV != PBIV) {
More information about the llvm-commits
mailing list