diff options
Diffstat (limited to 'llvm/lib/CodeGen/RegisterCoalescer.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegisterCoalescer.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index a808a541103f..9f4f23807d82 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -1855,8 +1855,8 @@ void RegisterCoalescer::updateRegDefsUses(Register SrcReg, Register DstReg, Reads = DstInt->liveAt(LIS->getInstructionIndex(*UseMI)); // Replace SrcReg with DstReg in all UseMI operands. - for (unsigned i = 0, e = Ops.size(); i != e; ++i) { - MachineOperand &MO = UseMI->getOperand(Ops[i]); + for (unsigned Op : Ops) { + MachineOperand &MO = UseMI->getOperand(Op); // Adjust <undef> flags in case of sub-register joins. We don't want to // turn a full def into a read-modify-write sub-register def and vice @@ -4136,9 +4136,9 @@ RegisterCoalescer::copyCoalesceInMBB(MachineBasicBlock *MBB) { void RegisterCoalescer::coalesceLocals() { copyCoalesceWorkList(LocalWorkList); - for (unsigned j = 0, je = LocalWorkList.size(); j != je; ++j) { - if (LocalWorkList[j]) - WorkList.push_back(LocalWorkList[j]); + for (MachineInstr *MI : LocalWorkList) { + if (MI) + WorkList.push_back(MI); } LocalWorkList.clear(); } @@ -4248,8 +4248,7 @@ bool RegisterCoalescer::runOnMachineFunction(MachineFunction &fn) { // Removing sub-register operands may allow GR32_ABCD -> GR32 and DPR_VFP2 -> // DPR inflation. array_pod_sort(InflateRegs.begin(), InflateRegs.end()); - InflateRegs.erase(std::unique(InflateRegs.begin(), InflateRegs.end()), - InflateRegs.end()); + InflateRegs.erase(llvm::unique(InflateRegs), InflateRegs.end()); LLVM_DEBUG(dbgs() << "Trying to inflate " << InflateRegs.size() << " regs.\n"); for (Register Reg : InflateRegs) { |
