* RFC: Help with updating LTO documentation
@ 2019-08-07 17:20 Steve Ellcey
2019-08-09 12:13 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Steve Ellcey @ 2019-08-07 17:20 UTC (permalink / raw)
To: gcc-patches
While trying to use the -flto and -fwhole-program flags I ran into problems
understanding what they do. I would like to update the documentation but I
still don't understand these flags enough to be able to describe their
behaviour. Here is the document section I would like to fix but don't
have enough information to do so.
From lto.texi:
| @subsection LTO modes of operation
|
| One of the main goals of the GCC link-time infrastructure was to allow
| effective compilation of large programs. For this reason GCC implements two
| link-time compilation modes.
|
| @enumerate
| @item @emph{LTO mode}, in which the whole program is read into the
| compiler at link-time and optimized in a similar way as if it
| were a single source-level compilation unit.
|
| @item @emph{WHOPR or partitioned mode}, designed to utilize multiple
| CPUs and/or a distributed compilation environment to quickly link
| large applications. WHOPR stands for WHOle Program optimizeR (not to
| be confused with the semantics of @option{-fwhole-program}). It
| partitions the aggregated callgraph from many different @code{.o}
| files and distributes the compilation of the sub-graphs to different
| CPUs.
What flag(s) do I use (or not use) to enable @emph{LTO mode}?
I am guessing that if I use -flto but not -flto-partition on a
link, this is what I get. Is that correct?
What flag(s) do I use to enable @emph{WHOPR or partitioned mode}?
I am guessing that this is -flto-partition? Do I also need -flto if I
am using -flto-partition? I don't see any description in lto.texi or in
common.opt of exactly what the various values for -flto-partition
(none, one, balanced, 1to1, max) do. Does such a description exist
anywhere?
Steve Ellcey
sellcey@marvell.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: RFC: Help with updating LTO documentation
2019-08-07 17:20 RFC: Help with updating LTO documentation Steve Ellcey
@ 2019-08-09 12:13 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2019-08-09 12:13 UTC (permalink / raw)
To: Steve Ellcey; +Cc: gcc-patches
On Wed, Aug 7, 2019 at 6:33 PM Steve Ellcey <sellcey@marvell.com> wrote:
>
> While trying to use the -flto and -fwhole-program flags I ran into problems
> understanding what they do. I would like to update the documentation but I
> still don't understand these flags enough to be able to describe their
> behaviour. Here is the document section I would like to fix but don't
> have enough information to do so.
>
> From lto.texi:
>
> | @subsection LTO modes of operation
> |
> | One of the main goals of the GCC link-time infrastructure was to allow
> | effective compilation of large programs. For this reason GCC implements two
> | link-time compilation modes.
> |
> | @enumerate
> | @item @emph{LTO mode}, in which the whole program is read into the
> | compiler at link-time and optimized in a similar way as if it
> | were a single source-level compilation unit.
> |
> | @item @emph{WHOPR or partitioned mode}, designed to utilize multiple
> | CPUs and/or a distributed compilation environment to quickly link
> | large applications. WHOPR stands for WHOle Program optimizeR (not to
> | be confused with the semantics of @option{-fwhole-program}). It
> | partitions the aggregated callgraph from many different @code{.o}
> | files and distributes the compilation of the sub-graphs to different
> | CPUs.
>
> What flag(s) do I use (or not use) to enable @emph{LTO mode}?
> I am guessing that if I use -flto but not -flto-partition on a
> link, this is what I get. Is that correct?
>
> What flag(s) do I use to enable @emph{WHOPR or partitioned mode}?
> I am guessing that this is -flto-partition? Do I also need -flto if I
> am using -flto-partition? I don't see any description in lto.texi or in
> common.opt of exactly what the various values for -flto-partition
> (none, one, balanced, 1to1, max) do. Does such a description exist
> anywhere?
"LTO mode" is merely legacy and can be invoked with
-flto -flto-partition=none while "WHOPR mode" is the default
and is used with plain -flto. Both modes use a linker-plugin
(if available) to enable "whole program" mode (aka auto-detection
of -fwhole-program). Not using a linker-plugin is legacy as well.
Richard.
> Steve Ellcey
> sellcey@marvell.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-09 11:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 17:20 RFC: Help with updating LTO documentation Steve Ellcey
2019-08-09 12:13 ` Richard Biener
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).