public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <jh@suse.cz>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: Jan Hubicka <jh@suse.cz>, "H.J. Lu" <hjl.tools@gmail.com>,
		gcc-patches@gcc.gnu.org, dnovillo@google.com
Subject: Re: Continue stmt branch prediction
Date: Wed, 19 Mar 2008 11:45:00 -0000	[thread overview]
Message-ID: <20080319112008.GA16554@kam.mff.cuni.cz> (raw)
In-Reply-To: <84fc9c000803190356p241cf5d5l83a80d13d79c9bfe@mail.gmail.com>

> On Wed, Mar 19, 2008 at 11:52 AM, Jan Hubicka <jh@suse.cz> wrote:
> > > Hi,
> >  >
> >  > This patch may have caused
> >  >
> >  > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35636
> >
> >  Yes, the testcase needs adjusting (with PREDICT_EXPR sitting in, there
> >  are no longer perfectly nested loops, but a butterfly CFG).  I will look
> >  into it.
> 
> PREDICT_EXPRs should not cause such effect (I still think they are
> ugly, but you made your point that BB or edge flags won't work).

If you have

  loopback:
    if (test1)
      goto loopback;
    if (test2)
      goto loopback;

You have two perfectly nested loops.  Now

  loopback:
    if (test1)
      {
        somecode;
        goto loopback;
      }
    somecode;
    if (test2)
      goto loopback;

You have two sibbling loops sharing header block.  The testcase is about
how loop infrastructure disambiguate the first case.  With predict_expr
in, we handle prediction more realistically (realizing that the test1 is
probably not closing loop construct since it comes from continue), but
disambiguation does not happen.

I will look into the other two cases tested by testcase but I think they
are same.  I think it is best to convert the inner loop into do-while
so it will still test the same.

Honza
> 
> Richard.

  reply	other threads:[~2008-03-19 11:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 20:59 Jan Hubicka
2008-02-10 14:00 ` Diego Novillo
2008-02-10 15:49   ` Jan Hubicka
2008-02-11  2:51     ` Diego Novillo
2008-02-11  8:21       ` Jan Hubicka
2008-02-11 22:42 ` Andrew MacLeod
2008-02-14 15:31   ` Jan Hubicka
2008-02-14 15:38     ` Richard Guenther
2008-02-14 17:49       ` Jan Hubicka
2008-02-14 18:27         ` Andrew MacLeod
2008-02-14 19:12           ` Jan Hubicka
2008-02-14 15:45     ` Andrew MacLeod
2008-02-14 18:11       ` Jan Hubicka
2008-03-05 18:33   ` Jan Hubicka
2008-03-05 22:10     ` Diego Novillo
2008-03-05 22:28       ` Jan Hubicka
2008-03-12 17:54         ` Diego Novillo
2008-03-13  1:38           ` Jan Hubicka
2008-03-13  1:41             ` Jan Hubicka
2008-03-13  9:21             ` Richard Guenther
2008-03-13 14:12             ` Diego Novillo
2008-03-19  6:33 ` H.J. Lu
2008-03-19 11:25   ` Jan Hubicka
2008-03-19 11:37     ` Richard Guenther
2008-03-19 11:45       ` Jan Hubicka [this message]
2008-03-19 13:21         ` Richard Guenther
2008-02-20 22:53 Bradley Lucier

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=20080319112008.GA16554@kam.mff.cuni.cz \
    --to=jh@suse.cz \
    --cc=dnovillo@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=richard.guenther@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).