[all-commits] [llvm/llvm-project] 8f0012: [NVPTX] Use .common linkage for common globals (#8...
Alex MacLean via All-commits
all-commits at lists.llvm.org
Thu Mar 14 13:30:24 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8f0012d3dc2ae6d40e9f812cae111ca7a6eb2a2d
https://github.com/llvm/llvm-project/commit/8f0012d3dc2ae6d40e9f812cae111ca7a6eb2a2d
Author: Alex MacLean <amaclean at nvidia.com>
Date: 2024-03-14 (Thu, 14 Mar 2024)
Changed paths:
M llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
A llvm/test/CodeGen/NVPTX/common-linkage.ll
M llvm/test/CodeGen/NVPTX/weak-global.ll
Log Message:
-----------
[NVPTX] Use .common linkage for common globals (#84416)
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.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list