mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Switch a number of loops in lib/CodeGen over to range-based for-loops, now that
the MachineRegisterInfo iterators are compatible with it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -187,10 +187,8 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB,
|
||||
// The source has other uses. See if we can replace the other uses with use of
|
||||
// the result of the extension.
|
||||
SmallPtrSet<MachineBasicBlock*, 4> ReachedBBs;
|
||||
for (MachineRegisterInfo::use_instr_nodbg_iterator
|
||||
UI = MRI->use_instr_nodbg_begin(DstReg), UE = MRI->use_instr_nodbg_end();
|
||||
UI != UE; ++UI)
|
||||
ReachedBBs.insert(UI->getParent());
|
||||
for (MachineInstr &UI : MRI->use_nodbg_instructions(DstReg))
|
||||
ReachedBBs.insert(UI.getParent());
|
||||
|
||||
// Uses that are in the same BB of uses of the result of the instruction.
|
||||
SmallVector<MachineOperand*, 8> Uses;
|
||||
@@ -199,10 +197,7 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB,
|
||||
SmallVector<MachineOperand*, 8> ExtendedUses;
|
||||
|
||||
bool ExtendLife = true;
|
||||
for (MachineRegisterInfo::use_nodbg_iterator
|
||||
UI = MRI->use_nodbg_begin(SrcReg), UE = MRI->use_nodbg_end();
|
||||
UI != UE; ++UI) {
|
||||
MachineOperand &UseMO = *UI;
|
||||
for (MachineOperand &UseMO : MRI->use_nodbg_operands(SrcReg)) {
|
||||
MachineInstr *UseMI = UseMO.getParent();
|
||||
if (UseMI == MI)
|
||||
continue;
|
||||
@@ -270,11 +265,9 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB,
|
||||
// Look for PHI uses of the extended result, we don't want to extend the
|
||||
// liveness of a PHI input. It breaks all kinds of assumptions down
|
||||
// stream. A PHI use is expected to be the kill of its source values.
|
||||
for (MachineRegisterInfo::use_instr_nodbg_iterator
|
||||
UI = MRI->use_instr_nodbg_begin(DstReg),
|
||||
UE = MRI->use_instr_nodbg_end(); UI != UE; ++UI)
|
||||
if (UI->isPHI())
|
||||
PHIBBs.insert(UI->getParent());
|
||||
for (MachineInstr &UI : MRI->use_nodbg_instructions(DstReg))
|
||||
if (UI.isPHI())
|
||||
PHIBBs.insert(UI.getParent());
|
||||
|
||||
const TargetRegisterClass *RC = MRI->getRegClass(SrcReg);
|
||||
for (unsigned i = 0, e = Uses.size(); i != e; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user