summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit0f055d3f56041deaac90ae275ba33f0919cf6070 (patch)
tree7c7df416d97432b288ef2b42c1cc94552a876eaf /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent27b3d55194ee3f8484efd3cec98576521e251d34 (diff)
downloadbcm5719-llvm-0f055d3f56041deaac90ae275ba33f0919cf6070.tar.gz
bcm5719-llvm-0f055d3f56041deaac90ae275ba33f0919cf6070.zip
Don't iterate through the whole block just to find the PHI nodes.
llvm-svn: 101900
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 10b0ee40360..704b63356a7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/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!");
OpenPOWER on IntegriCloud