[llvm] [AMDGPU] Generate waterfall for calls with SGPR(inreg) argument (PR #146997)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 00:51:11 PDT 2025


================
@@ -6929,7 +6934,15 @@ emitLoadScalarOpsFromVGPRLoop(const SIInstrInfo &TII,
       }
 
       // Update ScalarOp operand to use the SGPR ScalarOp.
-      ScalarOp->setReg(SScalarOp);
+      if (PhySGPRs.empty() || !PhySGPRs[Idx].isValid())
+        ScalarOp->setReg(SScalarOp);
+      else {
+        BuildMI(*ScalarOp->getParent()->getParent(),
+                ScalarOp->getParent()->getIterator(), DL, TII.get(AMDGPU::COPY),
----------------
arsenm wrote:

Avoid repeating ScalarOp->getParent()->getIterator()

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


More information about the llvm-commits mailing list