[all-commits] [llvm/llvm-project] 87c43f: [InstrProfiling] Delete linkage/visibility togglin...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Wed Jun 2 16:50:09 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 87c43f3aa99d778755c7f5420e955885f855ecad
https://github.com/llvm/llvm-project/commit/87c43f3aa99d778755c7f5420e955885f855ecad
Author: Fangrui Song <i at maskray.me>
Date: 2021-06-02 (Wed, 02 Jun 2021)
Changed paths:
M compiler-rt/test/profile/Windows/coverage-weak-lld.cpp
M llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
M llvm/test/Instrumentation/InstrProfiling/linkage.ll
M llvm/test/Instrumentation/InstrProfiling/platform.ll
M llvm/test/Instrumentation/InstrProfiling/profiling.ll
Log Message:
-----------
[InstrProfiling] Delete linkage/visibility toggling for Windows
The linkage/visibility of `__profn_*` variables are derived
from the profiled functions.
extern_weak => linkonce
available_externally => linkonce_odr
internal => private
extern => private
_ => unchanged
The linkage/visibility of `__profc_*`/`__profd_*` variables are derived from
`__profn_*` with linkage/visibility wrestling for Windows.
The changes can be folded to the following without changing semantics.
```
if (TT.isOSBinFormatCOFF() && !NeedComdat) {
Linkage = GlobalValue::InternalLinkage;
Visibility = GlobalValue::DefaultVisibility;
}
```
That said, I think we can just delete the code block.
An extern/internal function will now use private `__profc_*`/`__profd_*`
variables, instead of internal ones. This saves some symbol table entries.
A non-comdat {linkonce,weak}_odr function will now use hidden external
`__profc_*`/`__profd_*` variables instead of internal ones. There is potential
object file size increase because such symbols need `/INCLUDE:` directives.
However such non-comdat functions are rare (note that non-comdat weak
definitions don't prevent duplicate definition error).
The behavior changes match ELF.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D103355
More information about the All-commits
mailing list