[llvm] AMDGPU: Handle multiple AGPR MFMA rewrites (PR #147975)

Carl Ritson via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 3 22:59:05 PDT 2025


================
@@ -208,8 +218,19 @@ bool AMDGPURewriteAGPRCopyMFMAImpl::run(MachineFunction &MF) const {
 
       CopySrcMI->setDesc(TII.get(AGPROp));
 
-      // TODO: Is replacing too aggressive, fixup these instructions only?
-      MRI.replaceRegWith(CopySrcReg, VReg);
+      // Perform replacement of the register, rewriting the rewritable uses.
+      for (MachineInstr &UseMI :
----------------
perlfu wrote:

Is `UseMI` here misleading as `reg_instructions` will also include defs?

https://github.com/llvm/llvm-project/pull/147975


More information about the llvm-commits mailing list