[llvm] [AMDGPU] Refine operand iterators in the SIInsertWaitcnts. NFCI. (PR #108884)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 17 01:46:19 PDT 2024
================
@@ -1692,22 +1662,19 @@ bool SIInsertWaitcnts::generateWaitcntInstBefore(MachineInstr &MI,
// load). We also need to check WAW dependency with saved PC.
Wait = AMDGPU::Waitcnt();
- int CallAddrOpIdx =
- AMDGPU::getNamedOperandIdx(MI.getOpcode(), AMDGPU::OpName::src0);
-
- if (MI.getOperand(CallAddrOpIdx).isReg()) {
+ const auto *CallAddrOp = TII->getNamedOperand(MI, AMDGPU::OpName::src0);
----------------
jayfoad wrote:
Could make this a ref?
```suggestion
const auto &CallAddrOp = *TII->getNamedOperand(MI, AMDGPU::OpName::src0);
```
https://github.com/llvm/llvm-project/pull/108884
More information about the llvm-commits
mailing list