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

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 12:13:55 PDT 2018


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");
+
----------------
t-tye wrote:
> 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.
Posted patches  D44696 (CLANG) and  D44697 (LLVM) to increase implicit arg size to 48 bytes.


https://reviews.llvm.org/D43735





More information about the llvm-commits mailing list