[llvm] [AMDGPU] Analyze implicit reg operands when generating swaps (PR #192220)
Juan Manuel Martinez CaamaƱo via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 15 07:47:26 PDT 2026
================
@@ -617,12 +615,11 @@ ChangeKind SIShrinkInstructions::shrinkScalarLogicOp(MachineInstr &MI) const {
return ChangeKind::None;
}
-// This is the same as MachineInstr::readsRegister/modifiesRegister except
+// This is the same as MachineInstr::readsRegister except
// it takes subregs into account.
-bool SIShrinkInstructions::instAccessReg(
- iterator_range<MachineInstr::const_mop_iterator> &&R, Register Reg,
- unsigned SubReg) const {
- for (const MachineOperand &MO : R) {
+bool SIShrinkInstructions::instReadsReg(const MachineInstr *MI, Register Reg,
----------------
jmmartinez wrote:
I find the code duplication not great though.
What do you think about bringing back `instAccessReg` but making the input argument a template or a `filtered_const_mop_range` (both, all_uses and all_defs are).
https://github.com/llvm/llvm-project/pull/192220
More information about the llvm-commits
mailing list