[llvm] [AMDGPU] Support preloading hidden kernel arguments (PR #98861)

Austin Kerbow via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 17:37:14 PDT 2024


================
@@ -281,6 +468,14 @@ static bool lowerKernelArguments(Function &F, const TargetMachine &TM) {
   KernArgSegment->addRetAttr(
       Attribute::getWithAlignment(Ctx, std::max(KernArgBaseAlign, MaxAlign)));
 
+  if (InPreloadSequence) {
+    uint64_t ImplicitArgsBaseOffset =
+        alignTo(ExplicitArgOffset, ST.getAlignmentForImplicitArgPtr()) +
+        BaseOffset;
+    PreloadInfo.tryAllocImplicitArgPreloadSGPRs(ImplicitArgsBaseOffset,
+                                                Builder);
----------------
kerbowa wrote:

Not sure what you mean. This isn't in the main loop for handling arguments. It will also only preload implicit args that we have user SGPRs to allocate to or it gives up.

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


More information about the llvm-commits mailing list