From ce227ce3b38de1f8022b1497d7e1314903cf5674 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 11 Nov 2021 07:10:30 -0800 Subject: [CodeGen] Use MachineInstr::operands (NFC) --- llvm/lib/CodeGen/ModuloSchedule.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'llvm/lib/CodeGen/ModuloSchedule.cpp') diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp index d2c7e8c..f217723 100644 --- a/llvm/lib/CodeGen/ModuloSchedule.cpp +++ b/llvm/lib/CodeGen/ModuloSchedule.cpp @@ -713,15 +713,13 @@ void ModuloScheduleExpander::removeDeadInstructions(MachineBasicBlock *KernelBB, continue; } bool used = true; - for (MachineInstr::mop_iterator MOI = MI->operands_begin(), - MOE = MI->operands_end(); - MOI != MOE; ++MOI) { - if (!MOI->isReg() || !MOI->isDef()) + for (const MachineOperand &MO : MI->operands()) { + if (!MO.isReg() || !MO.isDef()) continue; - Register reg = MOI->getReg(); + Register reg = MO.getReg(); // Assume physical registers are used, unless they are marked dead. if (Register::isPhysicalRegister(reg)) { - used = !MOI->isDead(); + used = !MO.isDead(); if (used) break; continue; -- cgit v1.1