summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-20 14:46:25 +0000
committerDan Gohman <gohman@apple.com>2010-04-20 14:46:25 +0000
commit3f1403f14e45a862ff97c14d80a1daf28518722a (patch)
treee73fae97f69e6818363f290928d7abb0a12d6d35 /lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parenta9b2313c13a1bc8cbae751da03a9049ecaf0f918 (diff)
downloadllvm-3f1403f14e45a862ff97c14d80a1daf28518722a.tar.gz
llvm-3f1403f14e45a862ff97c14d80a1daf28518722a.tar.bz2
llvm-3f1403f14e45a862ff97c14d80a1daf28518722a.tar.xz
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
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 10b0ee4036..704b63356a 100644
--- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -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!");