public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Andrew Savchenko <bircoph@gmail.com>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Re: LTO use in the tree
Date: Tue, 29 Apr 2014 01:46:09 +0400	[thread overview]
Message-ID: <20140429014609.6ef75d4c308e6e9f7e67d058@gmail.com> (raw)
In-Reply-To: <CAGfcS_ksohxjSS_BdVKj-kmF1rJqYs=PJ9+_2U5s_aHo=qFPBg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]

Hello,

On Sun, 27 Apr 2014 07:23:11 -0400 Rich Freeman wrote:
> And yet, in the same paragraph you mention -O3, which is
> tantamount to just setting a flag and walking away.  That turns
> on 14 things you probably don't really need.

Why 14 things? According to gcc-4.8.2 manual -O3 enables the
following:
-finline-functions, -funswitch-loops, -fpredictive-commoning,
-fgcse-after-reload, -ftree-vectorize, -fvect-cost-model,
-ftree-partial-pre, -fipa-cp-clone.
Some of this options triggers another ones, but these 8 things are
sufficient to mimic -O3 completely.

From my experience only three of them are harmful:
-finline-functions and -fipa-cp-clone bloat code size significantly
hurting performance due to more CPU cache misses.
-ftree-vectorize may be used on amd64 (performance boost is in the
range -3.. +5%), but is a complete menace on x86: a lot of ICEs and
a lot of segfaults due to stack misalignment and even some working
but miscompiled code. While some (but not all) stack alignment
issues may be fixed with -mstackrealign, this drops performance
enhancement to negative values.

All other -O3 option have either no effect or measurable
performance enhancements in the range of several percent.

Tests were made using multimedia packages (mplayer, ffmpeg, x264)
and scientific ones (root, pythia, geant, blas libs).

Best regards,
Andrew Savchenko

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2014-04-28 21:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21  3:14 [gentoo-dev] LTO use in the tree Ryan Hill
2014-04-21  4:02 ` [gentoo-dev] " Ryan Hill
2014-04-22  8:45   ` Martin Vaeth
2014-04-26 10:23     ` Michał Górny
2014-04-26 11:15       ` Rich Freeman
2014-04-26 15:00         ` Martin Vaeth
2014-04-26 16:34           ` Rich Freeman
2014-04-26 19:58             ` Martin Vaeth
2014-04-27  0:34               ` "C. Bergström"
2014-04-27  2:14                 ` Alex Xu
2014-04-27  2:37                   ` "C. Bergström"
2014-04-27 11:23                     ` Rich Freeman
2014-04-27 11:41                       ` "C. Bergström"
2014-04-27 14:52                         ` Rich Freeman
2014-04-28  8:25                         ` Martin Vaeth
2014-04-28  8:53                           ` Tomáš Pružina
2014-04-27 22:56                       ` Joshua Kinard
2014-04-27 23:08                         ` Rich Freeman
2014-04-27 23:14                           ` Joshua Kinard
2014-04-28  0:40                             ` "C. Bergström"
2014-04-28  3:54                               ` Joshua Kinard
2014-04-28  4:49                               ` Richard Yao
2014-04-28 21:46                       ` Andrew Savchenko [this message]
2014-04-28 23:45                         ` Rich Freeman
2014-04-27 22:57                 ` Joshua Kinard
2014-04-28 21:08                 ` Andrew Savchenko
2014-04-27  0:49               ` Rich Freeman
2014-04-26 14:35       ` Martin Vaeth
2014-05-03  0:24     ` Ryan Hill
2014-04-22 18:10   ` Matt Turner
2014-05-02 23:55     ` Ryan Hill
2014-04-21  6:53 ` [gentoo-dev] " Michał Górny

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=20140429014609.6ef75d4c308e6e9f7e67d058@gmail.com \
    --to=bircoph@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    /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