public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@linaro.org>
To: Bernd Schmidt <bernds@codesourcery.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Rename across basic block boundaries
Date: Tue, 06 Sep 2011 10:37:00 -0000	[thread overview]
Message-ID: <g44o0q7y9f.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> (raw)
In-Reply-To: <4E64EBFA.5050004@codesourcery.com> (Bernd Schmidt's message of	"Mon, 05 Sep 2011 17:34:18 +0200")

Bernd Schmidt <bernds@codesourcery.com> writes:
> On 09/01/11 16:16, Richard Sandiford wrote:
>> Bernd Schmidt <bernds@codesourcery.com> writes:
>>> On 08/26/11 14:57, Richard Sandiford wrote:
>>>> Wouldn't a reverse post-order (inverted_post_order_compute) allow even
>>>> more pre-opening (as well as being less code)?
>>>
>>> I can't really tell from the comments what that function is supposed to
>>> produce.
>> 
>> Sorry, I thought it was supposed to produce a reverse postorder, but...
>> 
>>> I've made a change to use it to order the bbs, but that made rr
>>> visit basic blocks without seeing any of their predecessors first,
>> 
>> ...I guess not. :-)  pre_and_rev_post_order_compute should though.
>> Could you try that instead?
>
> That seems to work for me.

Looks good to me.  Maybe here:

> +  /* The order in which we visit blocks ensures that whenever
> +     possible, we only process a block after at least one of its
> +     predecessors, which provides a "seeding" effect to make the logic
> +     in set_incoming_from_chain and init_rename_info useful.  */
> +
> +  for (i = 0; i < n_bbs; i++)
> +    {
> +      basic_block bb1 = BASIC_BLOCK (inverse_postorder[i]);
> +      struct bb_rename_info *this_info = rename_info + i;
> [...]
> +      if (bb1->aux == NULL)
> +	continue;

it would be better to use:

  this_info = (struct bb_rename_info *) bb1->aux;

  if (this_info == NULL)
    continue;

so that we don't care which order the rename_info array is.  You could
then keep the original form of the first loop:

  /* Gather some information about the blocks in this function.  */
  rename_info = XCNEWVEC (struct bb_rename_info, n_basic_blocks);
  ri_index = 0;
  FOR_EACH_BB (bb)
    {
      struct bb_rename_info *ri = rename_info + ri_index;
      ri->bb = bb;
      ri->n_preds = EDGE_COUNT (bb->preds);
      bb->aux = ri;
      ri_index++;
    }

OK with me whichever.

Richard

  reply	other threads:[~2011-09-06 10:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21 14:12 Bernd Schmidt
2011-08-23 10:56 ` Ping: " Bernd Schmidt
2011-08-24 12:50 ` Richard Sandiford
2011-08-25 14:39   ` Bernd Schmidt
2011-08-25 19:04   ` Bernd Schmidt
2011-08-26 13:33     ` Richard Sandiford
2011-09-01 13:02       ` Bernd Schmidt
2011-09-01 14:16         ` Richard Sandiford
2011-09-05 15:36           ` Bernd Schmidt
2011-09-06 10:37             ` Richard Sandiford [this message]
2011-09-07 16:07               ` Bernd Schmidt

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=g44o0q7y9f.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com \
    --to=richard.sandiford@linaro.org \
    --cc=bernds@codesourcery.com \
    --cc=gcc-patches@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).