public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Easwaran Raman <eraman@google.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Fix PR middle-end/57370
Date: Fri, 30 Aug 2013 17:18:00 -0000	[thread overview]
Message-ID: <20130830170249.GS21876@tucnak.zalov.cz> (raw)
In-Reply-To: <CAPK5YPZp8zw6a6aJAD5nBMh_fZ3qFAu6pzjykRR9E9vCpVMJbg@mail.gmail.com>

On Fri, Aug 30, 2013 at 09:49:59AM -0700, Easwaran Raman wrote:
> Yes, this is pretty much what I was proposing. The current
> implementation doesn't rely on UIDs being unique - they only have to
> be monotonically non-decreasing. So, when a UID of 0 is encountered,
> go up till a non-zero UID is found and then go down and assign this
> non-zero UID. This effectively implies that each UID-0 stmt is visited
> at most twice. I don't think we need to check if I see more than
> certain number of UID-0 stmts and redo the entire BB.

Sure, renumbering the entire BB would be only for compile time reasons;
if you end up with a huge bb where 90% of stmts will have the same UID,
it is as if you weren't using UIDs at all and always walked the entire BB
to find out what stmt precedes what.  You could spend a lot of time in
appears_later_in_bb.

Looking at the code, couple of nits:
  return ((bb_a == bb_b && gimple_uid (a)  < gimple_uid (b))
extra space before <.

  gsi_next (&gsi);
  if (gsi_end_p (gsi))
    return stmt1;
  for (; !gsi_end_p (gsi); gsi_next (&gsi))
    {
...
    }
  return stmt1;

Why not just for (gsi_next (&gsi); !gsi_end_p (gsi); gsi_next (&gsi)) ?
The extra if (gsi_end_p (gsi)) return stmt1; doesn't make any sense
when the loop does exactly that too.

And for the debug stmts, are you sure you are resetting only those debug
stmts which you have to reset?  I mean, if there are say debug stmts using
the SSA_NAME in other bb, it doesn't need to be reset (unless you reuse
the same SSA_NAME for something else), and the compiler even has code
to reconstruct SSA_NAMEs that have been removed, but were still referenced
in debug stmts, using expressions in debug stmts and debug temporaries.

	Jakub

  reply	other threads:[~2013-08-30 17:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 17:21 Easwaran Raman
2013-07-12 15:36 ` Easwaran Raman
     [not found]   ` <CAPK5YPYXHtxs=+LpJNeZuKU+hmx80zjG1qQgeetxLt6qtGBSJA@mail.gmail.com>
2013-08-07 16:52     ` Easwaran Raman
2013-08-27 10:48     ` Richard Biener
2013-08-30  0:41       ` Easwaran Raman
2013-08-30  8:30         ` Richard Biener
2013-08-30 16:14           ` Easwaran Raman
2013-08-30 16:27             ` Jakub Jelinek
2013-08-30 17:02               ` Easwaran Raman
2013-08-30 17:18                 ` Jakub Jelinek [this message]
2013-09-02  9:31             ` Richard Biener
2013-09-04 17:50               ` Easwaran Raman
2013-09-05 19:23       ` Easwaran Raman
2013-09-06  7:05         ` Richard Biener
2013-09-06 18:47           ` Easwaran Raman
2013-09-09  8:58             ` Richard Biener

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=20130830170249.GS21876@tucnak.zalov.cz \
    --to=jakub@redhat.com \
    --cc=eraman@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).