[llvm] [AMDGPU] Enable serializing of allocated preload kernarg SGPRs info (PR #168374)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 11:56:07 PST 2025


================
@@ -2027,6 +2027,35 @@ bool GCNTargetMachine::parseMachineFunctionInfo(
                              MFI->ArgInfo.WorkItemIDZ, 0, 0)))
     return true;
 
+  // Parse FirstKernArgPreloadReg separately, since it's a Register,
+  // not ArgDescriptor.
+  if (YamlMFI.ArgInfo && YamlMFI.ArgInfo->FirstKernArgPreloadReg) {
+    const auto &A = *YamlMFI.ArgInfo->FirstKernArgPreloadReg;
+
+    if (!A.IsRegister) {
+      const MemoryBuffer &Buffer =
+          *PFS.SM->getMemoryBuffer(PFS.SM->getMainFileID());
+      Error =
+          SMDiagnostic(*PFS.SM, SMLoc(), Buffer.getBufferIdentifier(), 1, 0,
+                       SourceMgr::DK_Error,
+                       "firstKernArgPreloadReg must be a register", "", {}, {});
----------------
arsenm wrote:

Missing tests for the error cases 

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


More information about the llvm-commits mailing list