Skip to content

Commit 6332c36

Browse files
[AMDGPU] Use range-based for loops (NFC) (#106328)
1 parent 175aa86 commit 6332c36

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

llvm/lib/Target/AMDGPU/R600InstrInfo.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,9 @@ void R600InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
7575
/// \returns true if \p MBBI can be moved into a new basic.
7676
bool R600InstrInfo::isLegalToSplitMBBAt(MachineBasicBlock &MBB,
7777
MachineBasicBlock::iterator MBBI) const {
78-
for (MachineInstr::const_mop_iterator I = MBBI->operands_begin(),
79-
E = MBBI->operands_end(); I != E; ++I) {
80-
if (I->isReg() && !I->getReg().isVirtual() && I->isUse() &&
81-
RI.isPhysRegLiveAcrossClauses(I->getReg()))
78+
for (const MachineOperand &MO : MBBI->all_uses())
79+
if (!MO.getReg().isVirtual() && RI.isPhysRegLiveAcrossClauses(MO.getReg()))
8280
return false;
83-
}
8481
return true;
8582
}
8683

@@ -219,15 +216,10 @@ bool R600InstrInfo::readsLDSSrcReg(const MachineInstr &MI) const {
219216
if (!isALUInstr(MI.getOpcode())) {
220217
return false;
221218
}
222-
for (MachineInstr::const_mop_iterator I = MI.operands_begin(),
223-
E = MI.operands_end();
224-
I != E; ++I) {
225-
if (!I->isReg() || !I->isUse() || I->getReg().isVirtual())
226-
continue;
227-
228-
if (R600::R600_LDS_SRC_REGRegClass.contains(I->getReg()))
219+
for (const MachineOperand &MO : MI.all_uses())
220+
if (MO.getReg().isPhysical() &&
221+
R600::R600_LDS_SRC_REGRegClass.contains(MO.getReg()))
229222
return true;
230-
}
231223
return false;
232224
}
233225

0 commit comments

Comments
 (0)