diff options
author | Jay Foad <jay.foad@amd.com> | 2023-05-24 14:57:23 +0100 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2023-06-01 19:17:34 +0100 |
commit | 5022fc2ad31b5e3211e2458347c89412b8c5ec1b (patch) | |
tree | 3ce4e7d2001a8552c457ae8a0ec1b58fc669f4ae /llvm/lib/CodeGen/ModuloSchedule.cpp | |
parent | 2de54b919ba5fd9ccf37038cddfc36e97eb480af (diff) | |
download | llvm-5022fc2ad31b5e3211e2458347c89412b8c5ec1b.zip llvm-5022fc2ad31b5e3211e2458347c89412b8c5ec1b.tar.gz llvm-5022fc2ad31b5e3211e2458347c89412b8c5ec1b.tar.bz2 |
[CodeGen] Make use of MachineInstr::all_defs and all_uses. NFCI.
Differential Revision: https://reviews.llvm.org/D151424
Diffstat (limited to 'llvm/lib/CodeGen/ModuloSchedule.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ModuloSchedule.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp index af9fef0..0bef513 100644 --- a/llvm/lib/CodeGen/ModuloSchedule.cpp +++ b/llvm/lib/CodeGen/ModuloSchedule.cpp @@ -74,10 +74,7 @@ void ModuloScheduleExpander::expand() { // stage difference for each use. Keep the maximum value. for (MachineInstr *MI : Schedule.getInstructions()) { int DefStage = Schedule.getStage(MI); - for (const MachineOperand &Op : MI->operands()) { - if (!Op.isReg() || !Op.isDef()) - continue; - + for (const MachineOperand &Op : MI->all_defs()) { Register Reg = Op.getReg(); unsigned MaxDiff = 0; bool PhiIsSwapped = false; @@ -743,9 +740,7 @@ void ModuloScheduleExpander::removeDeadInstructions(MachineBasicBlock *KernelBB, continue; } bool used = true; - for (const MachineOperand &MO : MI->operands()) { - if (!MO.isReg() || !MO.isDef()) - continue; + for (const MachineOperand &MO : MI->all_defs()) { Register reg = MO.getReg(); // Assume physical registers are used, unless they are marked dead. if (reg.isPhysical()) { |