diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-12-30 15:27:33 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-12-30 15:27:33 +0000 |
commit | c7fc81e6595865296738fe0f8ffe692ea41b1ffc (patch) | |
tree | 9c14093b59b87a53d42ecbeb9c263c85f46f97e3 /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | |
parent | 06f6d262f99d4bc13739eb224084d239f5445682 (diff) | |
download | llvm-c7fc81e6595865296738fe0f8ffe692ea41b1ffc.zip llvm-c7fc81e6595865296738fe0f8ffe692ea41b1ffc.tar.gz llvm-c7fc81e6595865296738fe0f8ffe692ea41b1ffc.tar.bz2 |
Use phi ranges to simplify code. No functionality change intended.
llvm-svn: 321585
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index c7cdb49..81347fa 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -257,20 +257,20 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, // Create Machine PHI nodes for LLVM PHI nodes, lowering them as // appropriate. - for (BasicBlock::const_iterator I = BB.begin(); - const PHINode *PN = dyn_cast<PHINode>(I); ++I) { - if (PN->use_empty()) continue; + for (const PHINode &PN : BB.phis()) { + if (PN.use_empty()) + continue; // Skip empty types - if (PN->getType()->isEmptyTy()) + if (PN.getType()->isEmptyTy()) continue; - DebugLoc DL = PN->getDebugLoc(); - unsigned PHIReg = ValueMap[PN]; + DebugLoc DL = PN.getDebugLoc(); + unsigned PHIReg = ValueMap[&PN]; assert(PHIReg && "PHI node does not have an assigned virtual register!"); SmallVector<EVT, 4> ValueVTs; - ComputeValueVTs(*TLI, MF->getDataLayout(), PN->getType(), ValueVTs); + ComputeValueVTs(*TLI, MF->getDataLayout(), PN.getType(), ValueVTs); for (EVT VT : ValueVTs) { unsigned NumRegisters = TLI->getNumRegisters(Fn->getContext(), VT); const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo(); |