[PATCH] D49362: [ThinLTO] Compute constant references
Steven Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 16 10:00:02 PDT 2018
steven_wu added a comment.
> When importing a variable definition when the ref has this bit set, it can be imported as a local copy, without promoting the name/linkage type. That will avoid the need to do any modification to the optimization passes. On the exporting side, we could do prevent the promotion if we knew that all modules importing a reference also imported the referenced variable definition. It does however look like we should be importing all non-interposable linkage constant variables that are referenced, which should be all we care about for this anyway.
What if the constant is really big? Looks like the importing decision has to be made by the thin linker directly. You can not import the "constant" global as something like "available_externally constant" because the original copy might not be visible from the original module (just like the example), unless you want to modify the original copy to be "external hidden".
https://reviews.llvm.org/D49362
More information about the llvm-commits
mailing list