[PATCH] D119669: [NVPTX] Prefix "$L__" for branch label names

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 11:23:55 PST 2022


MaskRay accepted this revision.
MaskRay added a comment.

In D119669#3320132 <https://reviews.llvm.org/D119669#3320132>, @tra wrote:

> LGTM.
>
> In D119669#3319853 <https://reviews.llvm.org/D119669#3319853>, @MaskRay wrote:
>
>> Does NVPTX has such a specification?
>
> Official spec is here: https://docs.nvidia.com/cuda/parallel-thread-execution/index.html
> Unfortunately, it does not say much about labels and whether they have a concept of a local labal.

Thanks. If there is any channel communicating with them, it'd be nice to have this documented somewhere.

>> Also, if you grep `PrivateGlobalPrefix = `, having such a long `PrivateGlobalPrefix` is an outlier.
>
> PTX is a rather quirky assembly, so being an outlier is business as usual. :-/
>
> For what it's worth, `$L__` is what NVCC uses since CUDA-11.3 : https://godbolt.org/z/3q4be9PrG. 
> I guess `$` alone or `$L` may be sufficient to avoid name conflicts, but `$L__` is fine, too, IMO.

Cool. If NVCC uses `$L__`, this is definitely safe.
@slydiman please update the message to mention that the choice of `$L__` matches NVCC (not LLVM local invention).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119669



More information about the llvm-commits mailing list