[PATCH] D149451: [NVPTX] Add NVPTXCtorDtorLoweringPass to handle global ctors / dtors
Artem Belevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 28 11:08:39 PDT 2023
tra added a comment.
The standard CUDA runtime has no mechanisms for dealing with dynamic initializers, so enabling this pass in NVPTX back-end by default is not the right thing to do.
We may need to keep this pass behind some sort of flag, or add the it for stand-alone compilation mode only.
> An alternative is to also do what AMDGPU does and emit a kernel that can be called. I eschewed that mainly because we would get naming conflicts,
CUDA front-end uses `--cuid` for somewhat similar purpose of disambiguating TU-specific objects. We could pass it as an option to the pass to give each TU a unique ID and avoid naming conflicts.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149451/new/
https://reviews.llvm.org/D149451
More information about the llvm-commits
mailing list