diff options
author | Jay Foad <jay.foad@amd.com> | 2023-02-03 09:42:25 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2023-02-07 11:50:57 +0000 |
commit | d170a254a53bce54596ed0f94aa86ffa3eede42b (patch) | |
tree | a910e6d7c653f66b9435f0a28d58115de4e4a472 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 3d6b108a87cc017faf27824b82b90d9aaea707ca (diff) | |
download | llvm-d170a254a53bce54596ed0f94aa86ffa3eede42b.zip llvm-d170a254a53bce54596ed0f94aa86ffa3eede42b.tar.gz llvm-d170a254a53bce54596ed0f94aa86ffa3eede42b.tar.bz2 |
[CodeGen] Define and use MachineOperand::getOperandNo
This is a helper function to very slightly simplify many calls to
MachineInstruction::getOperandNo.
Differential Revision: https://reviews.llvm.org/D143250
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 2435873..a0e2043 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -1086,8 +1086,7 @@ auto MachineFunction::salvageCopySSAImpl(MachineInstr &MI) for (auto &MO : Inst->operands()) { if (!MO.isReg() || !MO.isDef() || MO.getReg() != State.first) continue; - return ApplySubregisters( - {Inst->getDebugInstrNum(), Inst->getOperandNo(&MO)}); + return ApplySubregisters({Inst->getDebugInstrNum(), MO.getOperandNo()}); } llvm_unreachable("Vreg def with no corresponding operand?"); @@ -1109,7 +1108,7 @@ auto MachineFunction::salvageCopySSAImpl(MachineInstr &MI) continue; return ApplySubregisters( - {ToExamine.getDebugInstrNum(), ToExamine.getOperandNo(&MO)}); + {ToExamine.getDebugInstrNum(), MO.getOperandNo()}); } } |