[llvm] [AMDGPU] Don't merge M0 initializations across calls that clobber M0 (PR #221963)

Pankaj Dwivedi via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 04:39:40 PDT 2026


================
@@ -489,6 +492,16 @@ static bool hoistAndMergeSGPRInits(unsigned Reg,
       Clobbers.push_back(&MI);
   }
 
+  if (Inits.empty())
+    return false;
+
+  // Calls clobber Reg with a regmask operand instead of an explicit def, so
+  // they do not appear on the def list of Reg.
+  for (MachineBasicBlock &MBB : MF)
----------------
PankajDwivedi-25 wrote:

other way would be record the calls inside the run where we are already iterating over function and pass it to hoistAndMergeSGPRInits.

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


More information about the llvm-commits mailing list