[PATCH] D103988: SampleFDO] place the discriminator flag variable into the used list.
Rong Xu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 15 16:58:54 PDT 2021
xur added a comment.
In D103988#2820735 <https://reviews.llvm.org/D103988#2820735>, @MaskRay wrote:
> CommonLinkage doesn't work.
>
> Whether `appendToUsed` is needed depends on whether the runtime has a live section referencing `__llvm_fs_discriminator__`.
> If the runtime has the guarantee, no need for `appendToUsed`.
>
> Otherwise, the first revision `appendToUsed` with `WeakODRLinkage` looks good to me.
>
> `appendToUsed` with `ExternalLinkage` in a comdat works as well, but comdat will need extra code when Mach-O wants this feature.
Fangri, thanks for reviewing this. This variable will NOT be referenced by compiler runtime library -- only be referenced by AutoFDO offline tool (to generate AFDO profile).
It seems that Fangri (as a linker expert) prefers my first implementation.
I'm OK either way. Hoy: what is your thought?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103988/new/
https://reviews.llvm.org/D103988
More information about the llvm-commits
mailing list