[llvm] [AMDGPU] Fix waterfall inreg call args on gfx90a: hoist defs + avoid AGPR sources (PR #194890)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 08:58:25 PDT 2026


================
@@ -7109,6 +7109,15 @@ static void emitLoadScalarOpsFromVGPRLoop(
     unsigned NumSubRegs = RegSize / 32;
     Register VScalarOp = ScalarOp->getReg();
 
+    // V_READFIRSTLANE_B32 / V_CMP_EQ_U32_e64 reject AGPR sources, so demote
+    // AV_* operands into a pure VGPR class on subtargets with AGPRs.
+    if (TRI->hasAGPRs(MRI.getRegClass(VScalarOp))) {
----------------
arsenm wrote:

This should do a subclass compatibilty check with the register class instead of hardcoding AGPR 

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


More information about the llvm-commits mailing list