<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
</span>This scares me a little for linkonce -- there's a minor change to<br>
semantics if the importing module would have linked against a<br>
*different* definition of the same symbol -- but I'm not really<br>
sure it matters much.<br>
<div><div class="h5"><br></div></div></blockquote><div><br></div><div><br></div><div>This should not be an issue in practice as it exists non thinLTO compilations too. For instance changing the optimization level of one module can lead to different inline decisions and different copy of the comdat function to be picked up in the end.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
><br></div></div><span class="">
<br>
</span>I wonder whether a prefix would be better?<br>
<br>
All the promotion/renaming scares me.  I feel like there may be<br>
dragons here we're not aware of.<br>
<br></blockquote><div><br></div><div>The promotion scheme is similar to LIPO which has been exercised on large number of huge C++ apps --  I think it is robust.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The only concrete concern I have (once you switch to hidden<br>
visibility) is the interaction with non-LTO'd objects being linked<br>
into the same executable, but I wonder if I'm missing something<br>
else, too...<br>
<div><div class="h5"><br></div></div></blockquote><div><br></div><div>There is an limitation (also with LIPO, LTO) that you can not compile one module say 'a.c' in thinLTO mode with the rest of the modules, and later recompile 'a.c' into 'a.o' without thinLTO and tries to mix and match with the rest of the real object files built with thinLTO unless 'a.c' is not imported by any other modules or it does not have any statics to be promoted.</div><div><br></div><div>thanks,</div><div><br></div><div>David</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
><br>
> 5  Linkage Change Summary Table<br>
><br>
> The following table summarizes the linkage change that happen during ThinLTO backend compilations. Note that the only time the linkage changes in the original module is for the static promotion case (for Internal and Private linkages), where it changes to External as described in Section 4.3.1. In all other cases the linkage in the original module stays the same, and therefore is not noted in the table below.<br>
><br>
> Note that there are no InternalLinkage, PrivateLinkage, AvailableExternallyLinkage, LinkOnce*Linkage, Weak*Linkage, AppendingLinkage and CommonLinkage declarations. There are no ExternalWeakLinkage definitions.<br>
><br>
> +---------------------------------+------------------------------------------------+<br>
> |                                 |        Importing Module Linkage                |<br>
> |    Original Module              +----------------------+-------------------------+<br>
> |                                 | Import definition    | Import as declaration   |<br>
> +----------------------------------------------------------------------------------+<br>
> | External (def)                  |  AvailableExternally |  External               |<br>
> +----------------------------------------------------------------------------------+<br>
> | External (decl)                 |  N/A                 |  External               |<br>
> +----------------+-----------------------------------------------------------------+<br>
> |                |  Promote[1]    |  AvailableExternally |  External               |<br>
> | Internal (def) +-----------------------------------------------------------------+<br>
> |                |  NoPromote     |  Internal            |  N/A (force import def) |<br>
> +----------------------------------------------------------------------------------+<br>
> |                |  Promote[1]    |  AvailableExternally |  External               |<br>
> | Private (def)  +-----------------------------------------------------------------+<br>
> |                |  NoPromote     |  Private             |  N/A (force import def) |<br>
> +----------------+-----------------------------------------------------------------+<br>
> | AvailableExternally (def)       |  AvailableExternally |  External               |<br>
> +----------------------------------------------------------------------------------+<br>
> | LinkOnceAny (def)               |  LinkOnceAny         |  N/A (force import def) |<br>
> +----------------------------------------------------------------------------------+<br>
> | LinkOnceODR (def)               |  LinkOnceODR         |  N/A (force import def) |<br>
> +----------------------------------------------------------------------------------+<br>
> | WeakAny (def)                   |  N/A (never import)  |  ExternalWeak           |<br>
> +----------------------------------------------------------------------------------+<br>
> | WeakODR (def)                   |  WeakODR             |  ExternalWeak           |<br>
> +----------------------------------------------------------------------------------+<br>
> | Appending (def) (only variables)|  N/A (never import)  |  N/A (never import)     |<br>
> +----------------------------------------------------------------------------------+<br>
> | ExternalWeak (decl)             |  N/A                 |  ExternalWeak           |<br>
> +----------------------------------------------------------------------------------+<br>
> | Common (def) (only variables)   |  Common              |  N/A (always import def)|<br>
> +---------------------------------+----------------------+-------------------------+<br>
><br>
> [1] Linkage in original module changes to External<br>
><br>
> --<br>
</div></div>> Teresa Johnson |       Software Engineer |     <a href="mailto:tejohnson@google.com">tejohnson@google.com</a> |  <a href="tel:408-460-2413" value="+14084602413">408-460-2413</a><br>
> <ThinLTOSymbolLinkageandRenaming.pdf>_______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div></div>