Peter Collingbourne
2015-Mar-19 21:34 UTC
[LLVMdev] [cfe-dev] Controlling the LTO optimization level
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[1] - '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 -O0Done. Thanks, -- Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-libLTO-llvm-lto-gold-Introduce-flag-for-controlling-.patch Type: text/x-diff Size: 18265 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150319/ad2d511c/attachment.patch>
Eric Christopher
2015-Mar-19 21:43 UTC
[LLVMdev] [cfe-dev] Controlling the LTO optimization level
Looks good I guess. The comment over the lower bitsets patch should probably reference why it's "required" and what it's for etc. This kind of pass addition is honestly one of the reasons why I was wanting command line options. It doesn't affect too much by adding it and then removing it, but unlike some of the target passes that are subtarget dependent the bitset pass is only useful if you happened to build with the cfi stuff on. -eric On Thu, Mar 19, 2015 at 2:34 PM Peter Collingbourne <peter at pcc.me.uk> wrote:> 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[1] - '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 > > Done. > > Thanks, > -- > Peter >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150319/61771311/attachment.html>
Peter Collingbourne
2015-Mar-19 22:03 UTC
[LLVMdev] [cfe-dev] Controlling the LTO optimization level
On Thu, Mar 19, 2015 at 09:43:13PM +0000, Eric Christopher wrote:> Looks good I guess.r232769.> The comment over the lower bitsets patch should probably reference why it's > "required" and what it's for etc.Done. Thanks, -- Peter