diff options
author | Owen Anderson <resistor@mac.com> | 2014-03-13 23:12:04 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2014-03-13 23:12:04 +0000 |
commit | 16c6bf49b7d7c41f45b334912c5fe4bc7528fa7c (patch) | |
tree | 647713f5dfbdea3c6de9ef82b3a270e47d1b79b1 /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | |
parent | b00cc1f92f2f01a396348b42ff1840543ffc0a7e (diff) | |
download | bcm5719-llvm-16c6bf49b7d7c41f45b334912c5fe4bc7528fa7c.tar.gz bcm5719-llvm-16c6bf49b7d7c41f45b334912c5fe4bc7528fa7c.zip |
Phase 2 of the great MachineRegisterInfo cleanup. This time, we're changing
operator* on the by-operand iterators to return a MachineOperand& rather than
a MachineInstr&. At this point they almost behave like normal iterators!
Again, this requires making some existing loops more verbose, but should pave
the way for the big range-based for-loop cleanups in the future.
llvm-svn: 203865
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index 9baf1ff0582..4fbf068b671 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -229,7 +229,7 @@ sink3AddrInstruction(MachineInstr *MI, unsigned SavedReg, for (MachineRegisterInfo::use_nodbg_iterator UI = MRI->use_nodbg_begin(SavedReg), UE = MRI->use_nodbg_end(); UI != UE; ++UI) { - MachineOperand &UseMO = UI.getOperand(); + MachineOperand &UseMO = *UI; if (!UseMO.isKill()) continue; KillMI = UseMO.getParent(); @@ -317,7 +317,7 @@ bool TwoAddressInstructionPass::noUseAfterLastDef(unsigned Reg, unsigned Dist, unsigned LastUse = Dist; for (MachineRegisterInfo::reg_iterator I = MRI->reg_begin(Reg), E = MRI->reg_end(); I != E; ++I) { - MachineOperand &MO = I.getOperand(); + MachineOperand &MO = *I; MachineInstr *MI = MO.getParent(); if (MI->getParent() != MBB || MI->isDebugValue()) continue; @@ -419,7 +419,7 @@ static bool isKilled(MachineInstr &MI, unsigned Reg, // go with what the kill flag says. if (std::next(Begin) != MRI->def_end()) return true; - DefMI = &*Begin; + DefMI = Begin->getParent(); bool IsSrcPhys, IsDstPhys; unsigned SrcReg, DstReg; // If the def is something other than a copy, then it isn't going to @@ -457,7 +457,7 @@ MachineInstr *findOnlyInterestingUse(unsigned Reg, MachineBasicBlock *MBB, if (!MRI->hasOneNonDBGUse(Reg)) // None or more than one use. return 0; - MachineInstr &UseMI = *MRI->use_nodbg_begin(Reg); + MachineInstr &UseMI = *MRI->use_instr_nodbg_begin(Reg); if (UseMI.getParent() != MBB) return 0; unsigned SrcReg; @@ -914,8 +914,8 @@ rescheduleMIBelowKill(MachineBasicBlock::iterator &mi, /// instruction too close to the defs of its register dependencies. bool TwoAddressInstructionPass::isDefTooClose(unsigned Reg, unsigned Dist, MachineInstr *MI) { - for (MachineRegisterInfo::def_iterator DI = MRI->def_begin(Reg), - DE = MRI->def_end(); DI != DE; ++DI) { + for (MachineRegisterInfo::def_instr_iterator DI = MRI->def_instr_begin(Reg), + DE = MRI->def_instr_end(); DI != DE; ++DI) { MachineInstr *DefMI = &*DI; if (DefMI->getParent() != MBB || DefMI->isCopy() || DefMI->isCopyLike()) continue; |