public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/65478] [5 regression] crafty performance regression
Date: Tue, 24 Mar 2015 14:10:00 -0000	[thread overview]
Message-ID: <bug-65478-4-ZwcXvZQ7ME@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65478-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65478

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamborm at gcc dot gnu.org

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I can confirm I can see a fairly consistent 4% run time increase
caused by r219863 on my desktop (from ~22.74s to ~23.64s).  However,
when I disable cloning of the Search function, for example by using
the attribute noclone, I only get to, ~23.31s which is still 2.5%
slower.  (All the times are of course subject to noise but I have
measured them repeatedly and as I said, they are fairly consistent).
This suggests that cloning of function Search and not inlining
NextMove is only part of the story.


> I would suggest we may disable/add negative hint for cloning in the
> case where the specialized function will end up calling
> unspecialized version of itself with non-cold edge.

Recursion is handled by iterating over SCCs in call graph in IPA-CP,
and the redirection of the final call to "close" the SCCs is done in a
different iteration than the first cloning.  This unfortunately means
that when function decide_about_value reasons about cloning or not, it
does not know what recursive calls are going to be redirected and
which are not.  Making it aware of this would require a hack in
cgraph_edge_brings_value_p functions.  I may try writing it but I
wonder whether it is really easier than undoing all cloning in an SCC,
which is the right way to implement this as it would also work for
recursions involving two or more functions.

> We also may consider adding bit of negative hints for cases where
> cloning would turn function called once (by noncold edge) to a
> function called twice.

This would be much easier, although the penalty would have to be quite
big because the goodness number calculated by
good_cloning_opportunity_p is 830 and the threshold is 500.

But given the above, perhaps, for gcc 5 at least, we might want to
introduce a 0.7 factor penalty for this and another 0.7 factor penalty
just for being within an SCC?


  parent reply	other threads:[~2015-03-24 13:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 22:38 [Bug tree-optimization/65478] New: " hubicka at gcc dot gnu.org
2015-03-19 22:45 ` [Bug tree-optimization/65478] " hubicka at gcc dot gnu.org
2015-03-20  2:51 ` [Bug ipa/65478] [5 regression] " hubicka at gcc dot gnu.org
2015-03-20 10:24 ` rguenth at gcc dot gnu.org
2015-03-20 18:25 ` hubicka at ucw dot cz
2015-03-20 19:19 ` hubicka at ucw dot cz
2015-03-24 14:10 ` jamborm at gcc dot gnu.org [this message]
2015-03-24 17:23 ` hubicka at ucw dot cz
2015-03-24 18:48 ` jamborm at gcc dot gnu.org
2015-03-25  7:57 ` hubicka at ucw dot cz
2015-03-27  9:45 ` jamborm at gcc dot gnu.org
2015-03-27  9:49 ` jamborm at gcc dot gnu.org
2015-03-29 14:15 ` hubicka at gcc dot gnu.org
2015-03-29 17:46 ` hubicka at gcc dot gnu.org
2015-03-30  2:23 ` hubicka at gcc dot gnu.org
2015-03-30 11:27 ` rguenth at gcc dot gnu.org
2015-03-30 17:53 ` hubicka at ucw dot cz
2015-03-30 20:02 ` glisse at gcc dot gnu.org
2015-03-30 21:40 ` hubicka at gcc dot gnu.org
2015-03-31 12:14 ` rguenther at suse dot de
2015-03-31 13:08 ` rguenth at gcc dot gnu.org
2015-04-01 14:43 ` rguenth at gcc dot gnu.org
2015-04-01 17:51 ` hubicka at ucw dot cz
2015-04-02  8:38 ` rguenther at suse dot de
2015-04-05 23:55 ` hubicka at gcc dot gnu.org
2015-04-07  8:49 ` 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-65478-4-ZwcXvZQ7ME@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).