[PATCH] D138531: [PATCH] [NVPTX] Backend support for variadic functions

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 16:33:31 PDT 2023


tra added a comment.

In D138531#4351471 <https://reviews.llvm.org/D138531#4351471>, @pavelkopyl wrote:

> I agree, the documentation is a bit messy. I used the information from section 5.1 State Spaces, in particular 5.1.6.4 <https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#device-function-parameters>. At least, it admits that one can take the address of a ".param" formal parameter and then use ld.local. On the other hand, it says nothing about when should do this, so yes, I mostly tried to mimic NVCC.

The conclusion from NVIDIA's side was exactly that -- if address is taken, everything gets magically copied into .local.
However, if one were to directly access the vararg, we'd still need to use ld.param.

Local copies tend to be expensive. We may eventually consider whether we can calculate access using offset vs the vararg argument w/o doing the math on the actual pointer. For now, accessing them via a local pointer would do.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138531



More information about the llvm-commits mailing list