public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Chris S <cs2991@gmail.com>
To: "Kewen.Lin" <linkw@linux.ibm.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: GCC 10 LTO documentation
Date: Sat, 3 Jul 2021 13:39:47 -0500	[thread overview]
Message-ID: <CACQ7eL6aOSDmAktGJMoFMkk3pckaRk8RQGU9ZYgg9tAJ5j8NFg@mail.gmail.com> (raw)
In-Reply-To: <d866b8f7-53ed-8006-0e83-76e8fed4e62a@linux.ibm.com>

Many thanks! This was extremely helpful, and reduced link time for that
binary by an hour. :)

Chris

On Wed, Jun 23, 2021 at 5:05 AM Kewen.Lin <linkw@linux.ibm.com> wrote:

> Hi,
>
> on 2021/6/21 下午9:41, Chris S via Gcc-help wrote:
> > Are the capabilities and/or limitations of GCC10 LTO documented anywhere?
> > I understand it only at a high level but not with details, and am having
> > trouble finding any current information that describes it very clearly.
> > Some questions came up recently that I'd like to be able to answer, but
> it
> > boils down to this:
> >
> > Is it possible to build static libraries that have LTO optimizations
> > applied to the object code they contain (that is, all the code in that
> > library is optimized together with LTO), but when built together into a
> > final binary, no additional LTO is performed?  We have several large,
> > static libraries that are mostly unrelated, and are looking for ways to
> > reduce a massive increase in build times after moving to g++10, where
> > almost 80% of the time is spent in LTO.
>
> If the compiling time is the concern, maybe it's worth to trying with
> LTO parallel build, such as -flto=auto or -flto=n.
>
>
> https://gcc.gnu.org/onlinedocs/gcc-10.3.0/gcc/Optimize-Options.html#Optimize-Options
>
> BR,
> Kewen
>
> > Having optimized individual
> > libraries but not a global optimized binary might be a reasonable
> > tradeoff.  Is this possible?
> >
> > I don't have a good mental model of when "extra information" (GIMPLE) is
> > merely included in the code for later use, and when that GIMPLE
> information
> > is actually used to perform LTO optimizations.  (My suspicion is that
> it's
> > only when building the final binary.)  However, if we can build static
> > libraries that are already optimized within themselves, a  hint of what
> > command line options to use would also be very appreciated.
> >
> > Thanks.
> > Chris
> >
>
>

      reply	other threads:[~2021-07-03 18:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 13:41 Chris S
2021-06-22 13:02 ` Jonathan Wakely
2021-06-22 15:05   ` Chris S
2021-06-22 15:14   ` Xi Ruoyao
2021-06-22 15:52     ` Jonathan Wakely
2021-06-22 16:08       ` Xi Ruoyao
2021-06-22 17:02         ` Jonathan Wakely
2021-06-23 10:04 ` Kewen.Lin
2021-07-03 18:39   ` Chris S [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACQ7eL6aOSDmAktGJMoFMkk3pckaRk8RQGU9ZYgg9tAJ5j8NFg@mail.gmail.com \
    --to=cs2991@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).