[lld] r301438 - LTO: Mark undefined module asm symbols as used.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 09:42:20 PDT 2017


On Apr 27, 2017 09:05, "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>
wrote:

> This is a small code quality regression. Before we had an internal GV
> that we knew we had to keep. Now we have an external GV.
>
> Would it be too hard to get it back?
>
> Cheers,
> Rafael
>
>
> Is there any difference between the two other than the linkage in the
object
> file?

Now that I think of it, this can probably be counted as a bug fix.

The advantage of making something internal is that it can allow for
optimizations like a custom calling convention.

But these symbols are being used from assembly, so those optimizations
would be invalid.

Thanks,
Rafael


Right, although I'd expect that taking the address in llvm.compiler.used
would have already prevented those sorts of optimizations.

The other thing is that we may be using linkage in the midend as an
optimization hint (for example, we may use a higher inlining threshold for
functions with internal linkage). But I'd expect those kinds of hints to
only apply to functions whose address is not taken (i.e. by
llvm.compiler.used). So we should be in the same position as before.

Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170427/6646bd40/attachment.html>


More information about the llvm-commits mailing list