[PATCH] D75138: [WIP][AMDGPU] Add Scratch Wave Offset to Scratch Buffer Descriptor in entry functions

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 17:03:42 PDT 2020


scott.linder added inline comments.


================
Comment at: llvm/docs/AMDGPUUsage.rst:8572
+      in :ref:`amdgpu-amdhsa-function-call-convention-non-kernel-functions`.
 
+.. _amdgpu-amdhsa-function-call-convention-non-kernel-functions:
----------------
t-tye wrote:
> Should the manner that the kernel prolog sets the scratch V# be specified? The compiler requests that the scratch V# and wave scratch offset be passed in using the kernel descriptor (reference the section), The wave scratch offset is added to the queue base address in the scratch V#and moved to SGPR0-3.
> 
> Also specify how the kernel must set the FLAT_SCRATCH. The compiler requests that the flat scratch and wave scratch offset be passed in using the kernel descriptor (reference the section), The wave scratch offset is added to the flat scratch base and moved to FLAT_SCRATCH.
> 
> Should setup up of M0 also be defined here. For GFX6-??? it is set to the LDS size, otherwise it is set to ???.
> 
> Any other setup that hs to be done in the kernel prolog?
I didn't notice originally that we have a section "Code Conventions > AMDHSA > Kernel Prolog" which already describes some of this. It seemed odd to put some of that here and some of that there, so I ended up trying to just move all the relevant bits to the Kernel Prolog section and reference it here. It ends up being a bit circular in that the Kernel Prolog section defers to the Calling Convention section for the definition of the ABI stack pointer, and the Calling Convention section defers to the Kernel Prolog section for the description of the properties of M0/FlatScratch/V# and how they are initialized. I think it is OK, but maybe you have some suggestions?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75138/new/

https://reviews.llvm.org/D75138





More information about the llvm-commits mailing list