public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/60315] [4.8/4.9 Regression] template constructor switch optimization
Date: Mon, 24 Feb 2014 14:22:00 -0000	[thread overview]
Message-ID: <bug-60315-4-QVHWQIckz9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60315-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60315

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note that we seem to fail to update BB predicates for switch stmts.

    size:0.000000, time:0.000000, predicate:(true)
    size:3.000000, time:2.000000, predicate:(not inlined)
    size:2.000000, time:2.000000, predicate:(op1 changed)
    size:8.000000, time:3.200000, predicate:(op1 changed) && (op1 != 2)

I cannot interpret the size 2 case (what is "op1 changed"?), but in that
case we actually shrink compared to not inlining.  As && op1 != 2 makes
it more restrictive it's odd that that increases the metrics.

As inliner I would inline all the (op1 changed) cases, thus in the above
case op1 == 2.

We seem to inline fully until hitting the case where only recursive edges
are left.  Even for only two switch cases we inline 5(!) calls into Test<E1>.

Ah, the switch isn't handled by the predicates because

 BB 3 predicate:(op1 != 1)
  s.1_4 = (int) s_2(D);
                freq:0.80 size:  0 time:  0
  switch (s.1_4) <default: <L8>, case 0: <L1>, case 1: <L2>>

it is not unmodified_parm_or_parm_agg_item ().  The parameter is unsigned int
so the cast is not value-preserving.

Of course in general we can't rely on "proper" predicates so we need to avoid
exploding reliably.


  parent reply	other threads:[~2014-02-24 14:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22  5:53 [Bug c++/60315] New: " garcia.espinosa.jr at gmail dot com
2014-02-22  9:00 ` [Bug ipa/60315] [4.8/4.9 Regression] " glisse at gcc dot gnu.org
2014-02-22 13:59 ` rguenth at gcc dot gnu.org
2014-02-24 11:27 ` rguenth at gcc dot gnu.org
2014-02-24 11:36 ` rguenth at gcc dot gnu.org
2014-02-24 13:00 ` rguenth at gcc dot gnu.org
2014-02-24 13:48 ` rguenth at gcc dot gnu.org
2014-02-24 13:50 ` rguenth at gcc dot gnu.org
2014-02-24 14:22 ` rguenth at gcc dot gnu.org [this message]
2014-02-27  9:35 ` rguenth at gcc dot gnu.org
2014-03-18 11:44 ` jakub at gcc dot gnu.org
2014-03-24 22:44 ` hubicka at gcc dot gnu.org
2014-03-24 23:01 ` hubicka at gcc dot gnu.org
2014-03-24 23:35 ` hubicka at gcc dot gnu.org
2014-03-25  5:44 ` hubicka at gcc dot gnu.org
2014-03-26  2:12 ` hubicka at gcc dot gnu.org
2014-03-26  2:20 ` hubicka at gcc dot gnu.org
2014-03-26  9:00 ` rguenther at suse dot de
2014-03-26 21:58 ` hubicka at ucw dot cz
2014-03-27  7:30 ` rguenther at suse dot de
2014-05-22  9:06 ` [Bug ipa/60315] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:28 ` [Bug ipa/60315] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-02-24 11:00 ` jakub at gcc dot gnu.org
2015-02-24 11:42 ` [Bug ipa/60315] [4.8 " rguenth at gcc dot gnu.org
2015-06-23  8:48 ` rguenth at gcc dot gnu.org

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=bug-60315-4-QVHWQIckz9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).