public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>, Richard Biener <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Don't add unnecessary var self-conflicts (PR tree-optimization/86214)
Date: Wed, 16 Jan 2019 22:52:00 -0000	[thread overview]
Message-ID: <8450427d-76a1-43e3-fb72-1ea15ceb6b34@redhat.com> (raw)
In-Reply-To: <20190116224901.GB30353@tucnak>

On 1/16/19 3:49 PM, Jakub Jelinek wrote:
> Hi!
> 
> While looking at this PR (I've just started) I've noticed that
> add_stack_var_conflict is quite often called with x == y.
> We don't really need to record that a variable conflicts with itself,
> the only reader of the conflicts bitmaps, stack_var_conflict_p,
> starts with
>   if (x == y)
>     return false;
> conflicts bitmap are set either by this function, or by the
>               EXECUTE_IF_SET_IN_BITMAP (work, 0, i, bi)
>                 {
>                   struct stack_var *a = &stack_vars[i];
>                   if (!a->conflicts)
>                     a->conflicts = BITMAP_ALLOC (&stack_var_bitmap_obstack);
>                   bitmap_ior_into (a->conflicts, work);
>                 }
> code (where work isn't derived from any conflicts bitmap though, so
> doesn't care if we've added those self-conflicts or not).  The above
> bitmap_ior_into stuff actually always sets self-conflicts (if you think
> bitmap_clear_bit is worth it, I can add it afterwards though).
> 
> But I think the following patch is helpful, don't create the conflicts
> bitmaps at all if all we'd record is just self-conflict which we'll ignore.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> 2019-01-16  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR tree-optimization/86214
> 	* cfgexpand.c (add_stack_var_conflict): Don't add any conflicts
> 	if x == y.
Yea.  Seems reasonable.

jeff

      reply	other threads:[~2019-01-16 22:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 22:49 Jakub Jelinek
2019-01-16 22:52 ` Jeff Law [this message]

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=8450427d-76a1-43e3-fb72-1ea15ceb6b34@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=rguenther@suse.de \
    /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).