[llvm] [AMDGPU] Add support for preloading implicit kernel arguments (PR #83817)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 13:02:32 PDT 2024


================
@@ -3210,4 +3210,12 @@ def int_amdgcn_addrspacecast_nonnull : DefaultAttrsIntrinsic<
   [llvm_anyptr_ty], [llvm_anyptr_ty],
   [IntrNoMem, IntrSpeculatable]
 >;
+
+// This intrinsic is used to track the user SGPRs that hold implicit kernel
+// arguments. The i32 argument for this intrinsic represents the offset in
+// bytes from the value pointed to by the implicitarg pointer.
+def int_amdgcn_preload_implicitarg :
----------------
arsenm wrote:

This flow sounds backwards. You shouldn't need to identify the loads, they shouldn't appear in CodeGen in the first place. I would expect the IR pass marking the inreg arguments to replace the load uses with the direct argument use. The argument lowering would then just emit the CopyFromReg from the correct position for the inreg cases (instead of the legacy emit load lowering we have now) 

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


More information about the llvm-commits mailing list