public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Andrew Pinski <pinskia@gmail.com>
Cc: Jan Hubicka <hubicka@ucw.cz>, Jeff Law <law@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: backward threading heuristics tweek
Date: Thu, 11 Aug 2016 11:35:00 -0000	[thread overview]
Message-ID: <20160811113516.GA67433@kam.mff.cuni.cz> (raw)
In-Reply-To: <CA+=Sn1mXz9ONrYAh_D3NO=YyPxiy7KKe5yjd+gj3G04ch8Hz3Q@mail.gmail.com>

> On Mon, Jun 6, 2016 at 3:19 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> > while looking into profile mismatches introduced by the backward threading pass
> > I noticed that the heuristics seems quite simplistics.  First it should be
> > profile sensitive and disallow duplication when optimizing cold paths. Second
> > it should use estimate_num_insns because gimple statement count is not really
> > very realistic estimate of final code size effect and third there seems to be
> > no reason to disable the pass for functions optimized for size.
> >
> > If we block duplication for more than 1 insns for size optimized paths the pass
> > is able to do majority of threading decisions that are for free and improve codegen.
> > The code size benefit was between 0.5% to 2.7% on testcases I tried (tramp3d,
> > GCC modules, xlanancbmk and some other stuff around my hd).
> >
> > Bootstrapped/regtested x86_64-linux, seems sane?
> >
> > The pass should also avoid calling cleanup_cfg when no trheading was done
> > and i do not see why it is guarded by expensive_optimizations. What are the
> > main compile time complexity limitations?
> 
> This patch caused a huge regression (~11%) on coremarks on ThunderX.
> I assume other targets too.
> Basically it looks like the path is no longer thread jumped.

Sorry for late reply. I checked our periodic testers and the patch seems more or less
performance neutral with some code size improvements. Can you point me to the path that
is no longer crossjumped? I added diag output, so you should see the reason why the
path was considered unprofitable - either it was cold or we exceeded the maximal size.
The size is largely untuned, so perhaps we can just adjust it.

Honza

  parent reply	other threads:[~2016-08-11 11:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 10:19 Jan Hubicka
2016-08-05 21:34 ` Jeff Law
2016-08-07 17:31 ` Andrew Pinski
2016-08-08  8:29   ` James Greenhalgh
2016-08-11 12:36     ` Jan Hubicka
2016-08-15 16:57       ` Jeff Law
2016-08-15 20:06         ` Jan Hubicka
2016-08-16 15:43           ` Jeff Law
2016-08-11 11:35   ` Jan Hubicka [this message]
2016-08-12 15:07     ` James Greenhalgh

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=20160811113516.GA67433@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=pinskia@gmail.com \
    /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).