Don't iterate through the whole block just to find the PHI nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-04-20 14:46:25 +00:00
parent a9b2313c13
commit 3f1403f14e

View File

@ -211,13 +211,10 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
// Create Machine PHI nodes for LLVM PHI nodes, lowering them as
// appropriate.
const PHINode *PN;
DebugLoc DL;
for (BasicBlock::const_iterator
I = BB->begin(), E = BB->end(); I != E; ++I) {
PN = dyn_cast<PHINode>(I);
if (!PN || PN->use_empty()) continue;
for (BasicBlock::const_iterator I = BB->begin();
const PHINode *PN = dyn_cast<PHINode>(I); ++I) {
if (PN->use_empty()) continue;
unsigned PHIReg = ValueMap[PN];
assert(PHIReg && "PHI node does not have an assigned virtual register!");