From: Eric Botcazou <ebotcazou@adacore.com>
To: Marek Polacek <polacek@redhat.com>,
Richard Biener <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Don't bypass blocks with multiple latch edges (PR middle-end/54838)
Date: Thu, 29 Nov 2012 17:45:00 -0000 [thread overview]
Message-ID: <5890792.ZMS3qalP0H@polaris> (raw)
In-Reply-To: <20121129153852.GC10621@redhat.com>
> Yikes, sorry, it wasn't clear to me what PROP_loops really does. Anyway,
> I think I have a better fix now. The problem is just that when removing
> BB 4 (which was a header), we have to zap ->header and ->latch. We
> already have code for this:
>
> if (current_loops != NULL
> && e->src->loop_father->latch == e->src)
> {
> /* ??? Now we are creating (or may create) a loop
> with multiple entries. Simply mark it for
> removal. Alternatively we could not do this
> threading. */
> e->src->loop_father->header = NULL;
> e->src->loop_father->latch = NULL;
> }
>
> but the thing is that when there are multiple latch edges, then
> ->latch is NULL. So we need to keep track of how many latch edges
> the header has. Regtested/bootstrapped on x86_64, ok for trunk?
>
> Can I get rid of may_be_loop_header (and just use n_latch_edges > 0
> instead at that one place) in a followup?
>
> 2012-11-29 Marek Polacek <polacek@redhat.com>
>
> PR middle-end/54838
> * cprop.c (bypass_block): Set header and latch to NULL when
> BB has more than one latch edge.
> (n_latches): New variable.
This looks good on principle, but can't we do better now that we have the loop
structure? Can't we compute is_loop_header instead of may_be_loop_header and
simplify the condition under which we mark the loop for removal? Or maybe we
should call disambiguate_loops_with_multiple_latches on entry of the pass?
Richard, what would be the "modern" approach to solving the problem here?
--
Eric Botcazou
next prev parent reply other threads:[~2012-11-29 17:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 14:28 Marek Polacek
2012-11-28 9:55 ` Eric Botcazou
2012-11-28 18:39 ` Marek Polacek
2012-11-29 8:34 ` Richard Biener
2012-11-29 8:57 ` Steven Bosscher
2012-11-29 9:35 ` Richard Biener
2012-11-29 15:39 ` Marek Polacek
2012-11-29 15:42 ` Marek Polacek
2012-11-29 15:51 ` Steven Bosscher
2012-11-29 16:56 ` Marek Polacek
2012-11-29 17:45 ` Eric Botcazou [this message]
2012-11-30 9:02 ` Richard Biener
2012-11-30 16:28 ` Marek Polacek
2012-11-30 22:01 ` Eric Botcazou
2012-11-30 22:33 ` Eric Botcazou
2012-12-01 16:18 ` Marek Polacek
2012-12-02 10:06 ` Eric Botcazou
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=5890792.ZMS3qalP0H@polaris \
--to=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=polacek@redhat.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).