would linker do some lto work? what kind of lto work it would do?

188 views
Skip to first unread message

xie cui

unread,
Dec 30, 2020, 9:51:15 AM12/30/20
to golang-nuts
would  linker do some lto work? what kind of lto work it would do?

Ian Lance Taylor

unread,
Dec 30, 2020, 1:45:07 PM12/30/20
to xie cui, golang-nuts
On Wed, Dec 30, 2020 at 6:52 AM xie cui <cuiw...@gmail.com> wrote:
>
> would linker do some lto work? what kind of lto work it would do?

Because Go uses explicit package imports, and because imports may not
have cycles, a lot of work that can only be done at link time for
C-like languages can be done at compile time by Go. For example, the
single biggest gain from LTO for C is inlining functions across
different object files. But the Go compiler does this at compile
time.

So let me turn the question around: what advantages would you expect
to see from using LTO in the Go linker?

Ian
Reply all
Reply to author
Forward
0 new messages