[LLVMdev] [cfe-dev] Controlling the LTO optimization level
peter at pcc.me.uk
Thu Mar 19 14:34:33 PDT 2015
On Thu, Mar 19, 2015 at 01:43:25PM -0700, Duncan P. N. Exon Smith wrote:
> This SGTM in principle. The specific set of passes that you've enabled at
> -O1 seems strangely small to me, but we can adjust that later.
Sure. (It seemed best to me for this set to be small, at least for now,
because LTO is single-threaded, unlike regular optimization in a parallelized
build system, and so the cost of enabling a given pass is larger, especially
at lower optimization levels. The passes I selected seemed to provide enough
benefit to justify the cost.)
> Should this -O level be shared with CodeGen?
Seems reasonable, done.
> > On 2015-Mar-19, at 13:13, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> > + OptLevel = opt - '0';
> > Please check and reject things like -OX at least in the gold plugin.
> Same with the libLTO API and `llvm-lto`.
> It might be nice to write a single utility function to verify this that's
> shared between the three consumers?
Maybe. That might wait until the consumers share some kind of common flag
parsing API though. At the moment they're different enough that it's simplest
to just write out the check in each one.
> > Can you add a test showing that
> > * createLowerBitSetsPass is run at -O0
> > * the addLateLTOOptimizationPasses passes are run at -O1, but not -O0
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 18265 bytes
Desc: not available
More information about the llvm-dev