diff options
author | Alex MacLean <amaclean@nvidia.com> | 2024-03-29 11:58:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-29 11:58:41 -0700 |
commit | 7daa65a088c00891662d5e7e162e5f8f3283f799 (patch) | |
tree | 27302fde5b319c7e177d0441c87c210f96b395c9 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | fe893c93b7bd3b3c436b97383db21e08c9ec4b25 (diff) | |
download | llvm-7daa65a088c00891662d5e7e162e5f8f3283f799.zip llvm-7daa65a088c00891662d5e7e162e5f8f3283f799.tar.gz llvm-7daa65a088c00891662d5e7e162e5f8f3283f799.tar.bz2 |
Reland "[NVPTX] Use .common linkage for common globals" (#86824)
Switch from `.weak` to `.common` linkage for common global variables
where possible. The `.common` linkage is described in
[PTX ISA 11.6.4. Linking Directives: .common]
(https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#linking-directives-common)
> Declares identifier to be globally visible but “common”.
>
>Common symbols are similar to globally visible symbols. However
multiple object files may declare the same common symbol and they may
have different types and sizes and references to a symbol get resolved
against a common symbol with the largest size.
>
>Only one object file can initialize a common symbol and that must have
the largest size among all other definitions of that common symbol from
different object files.
>
>.common linking directive can be used only on variables with .global
storage. It cannot be used on function symbols or on symbols with opaque
type.
I've updated the logic and tests to only use `.common` for PTX 5.0 or
greater and verified that the new tests now pass with `ptxas`.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
0 files changed, 0 insertions, 0 deletions