[PATCH] D43735: [AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 00:41:56 PDT 2018


t-tye marked 3 inline comments as done.
t-tye added inline comments.


================
Comment at: lib/CodeGen/TargetInfo.cpp:7661
+  if (M.getLangOpts().OpenCL && FD->hasAttr<OpenCLKernelAttr>() && (M.getTriple().getOS() == llvm::Triple::AMDHSA))
+    F->addFnAttr("amdgpu-implicitarg-num-bytes", "32");
+
----------------
yaxunl wrote:
> t-tye wrote:
> > yaxunl wrote:
> > > Now we support enqueue_kernel, there are two extra hidden arguments. Totally 6 hidden arguments. The implicitarg-num-bytes should be 48 now.
> > Can you give the ABI for these implicit arguments so can update the AMDGUUsage document?
> The first 3 implicit arguments are x, y, z components of global offset.
> The 4-th implicit argument is pointer to printf buffer.
> The 5-th implicit argument is pointer to virtual queue used by enqueue_kernel.
> The 6-th implicit argument is pointer to AqlWrap struct used by enqueue_kernel.
> The size and alignment of each implicit argument is 8. 
Added description to AMDGPUUsage for current 4 implicit arguments.

Will address change for device enqueue as a separate patch.


https://reviews.llvm.org/D43735





More information about the llvm-commits mailing list