Skip to content

Commit 494c637

Browse files
authored
MachineInstrBundle: modernize a couple of loops (NFC) (#89229)
1 parent 7c7704c commit 494c637

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/lib/CodeGen/MachineInstrBundle.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ llvm::AnalyzeVirtRegLanesInBundle(const MachineInstr &MI, Register Reg,
312312

313313
LaneBitmask UseMask, DefMask;
314314

315-
for (ConstMIBundleOperands O(MI); O.isValid(); ++O) {
316-
const MachineOperand &MO = *O;
315+
for (const MachineOperand &MO : const_mi_bundle_ops(MI)) {
317316
if (!MO.isReg() || MO.getReg() != Reg)
318317
continue;
319318

@@ -339,9 +338,7 @@ PhysRegInfo llvm::AnalyzePhysRegInBundle(const MachineInstr &MI, Register Reg,
339338
PhysRegInfo PRI = {false, false, false, false, false, false, false, false};
340339

341340
assert(Reg.isPhysical() && "analyzePhysReg not given a physical register!");
342-
for (ConstMIBundleOperands O(MI); O.isValid(); ++O) {
343-
const MachineOperand &MO = *O;
344-
341+
for (const MachineOperand &MO : const_mi_bundle_ops(MI)) {
345342
if (MO.isRegMask() && MO.clobbersPhysReg(Reg)) {
346343
PRI.Clobbered = true;
347344
continue;

0 commit comments

Comments
 (0)