[PATCH] D107249: [GlobalOpt] Don't replace alias with aliasee if either alias/aliasee may be preemptible
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 31 17:30:51 PST 2022
MaskRay added a comment.
In D107249#3285600 <https://reviews.llvm.org/D107249#3285600>, @efriedma wrote:
> Do we need to fix other places? I tried grepping for GlobalAlias, and at least BasicAliasAnalysis.cpp and MemoryBuiltins.cpp and StackSafetyAnalysis.cpp contain similar isInterposable() checks.
Maybe. Perhaps cross that bridge when we come to it.
> In D107249#2919094 <https://reviews.llvm.org/D107249#2919094>, @efriedma wrote:
>
>> 2. Can we forbid aliases that refer to globals that are interposable, or use weak linkage? In theory, this prohibition doesn't cause any loss of generality in IR: we can turn a weak definition into an alias pointing to an internal definition, which should be essentially equivalent.
>
> Any comment on this?
We cannot reject such aliases. GCC supports:
int aliasee __attribute__((weak));
extern int alias __attribute__((alias("aliasee")));
Perhaps LLVM's instrumentations are better of not creating such aliases, but the IR needs to be handled.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107249/new/
https://reviews.llvm.org/D107249
More information about the llvm-commits
mailing list