[PATCH] D49362: [ThinLTO] Compute constant references

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 10:05:16 PDT 2018


tejohnson added a comment.

In https://reviews.llvm.org/D49362#1163768, @steven_wu wrote:

> > 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".


Not sure I understand your question, can you clarify the concern? Right now, computeImportForReferencedGlobals during the thin link we import any referenced variable, unless it has interposable linkage or references other summaries (in which case it is not  a constant). The imported variables are imported as available externally definitions. The original definition is currently promoted to external hidden.


https://reviews.llvm.org/D49362





More information about the llvm-commits mailing list