public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path
Date: Wed, 02 Dec 2015 22:57:00 -0000	[thread overview]
Message-ID: <565F773B.60908@redhat.com> (raw)
In-Reply-To: <CAFiYyc1_vj8L3CzhCf8sQrPHu8EOo8q2W3OPFwotVetgte5Jmw@mail.gmail.com>

On 12/02/2015 08:35 AM, Richard Biener wrote:

>>> be possible to make it do that much like I extended SCCVN to do this
>>> (when doing the DOM walk see if any incoming edge is marked executable
>>> and if not, mark all outgoing edges as not executable, if the block is
>>> executable
>>> at the time we process the last stmt determine if we can compute the edge
>>> that ends up always executed and mark all others as not executable)
>>
>> Essentially yes. I'm using the not-executable flag and bypassing things when
>> it's discovered.
I took at look at what you did with SCCVN and I like it better than what 
I was doing -- your handling is more complete.

There's some code that ought to be factored out.  In particular at the 
start of before_dom_children you've got code that clears 
EDGE_EXECUTABLE.   There's no reason we should duplicate in SCCVN, DOM 
and perhaps other DOM walkers in the future.  If you've got a place in 
mind where you think it ought to live (cfg-something) speak up.  Else 
I'll find a spot on my own.




>>
>> The most interesting side effect, and one I haven't fully analyzed yet is an
>> unexpected jump thread -- which I've traced back to differences in what the
>> alias oracle is able to find when we walk unaliased vuses. Which makes
>> totally no sense that it's unable to find the unaliased vuse in the
>> simplified CFG, but finds it when we don't remove the unexecutable edge.  As
>> I said, it makes no sense to me yet and I'm still digging.
>
> The walking of PHI nodes is quite simplistic to avoid doing too much work so
> an extra (not executable) edge may confuse it enough.  So this might be
> "expected".  Adding a flag on whether EDGE_EXECUTABLE is to be
> trusted would be an option (also helping SCCVN).
It was actually the opposite effect.  ie, with the simplified CFG, we 
missed the jump thread, but with the more complex CFG we found the jump 
thread.  And the edge we were removing didn't (at first glance) appear 
to be of any real significance.

I'm not seeing the oddity anymore now that I've converted DOM to mimick 
what you were doing in SCCVN.  So I'm going to assume I botched 
something somewhere.

Back to analysis to see if there's other fallout.

jeff

  reply	other threads:[~2015-12-02 22:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07  2:26 Jeff Law
2015-10-07  8:26 ` Richard Biener
2015-10-07 22:00   ` Jeff Law
2015-10-08  9:56     ` Richard Biener
2015-10-09 15:45       ` Jeff Law
2015-12-01 21:32         ` Jeff Law
2015-12-02  9:54           ` Richard Biener
2015-12-02 15:31             ` Jeff Law
2015-12-02 15:35               ` Richard Biener
2015-12-02 22:57                 ` Jeff Law [this message]
2015-12-03  9:57                   ` Richard Biener
2015-12-03 20:29                 ` Jeff Law
2015-12-04 10:12                   ` Richard Biener
2015-12-04 17:18                     ` Jeff Law

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=565F773B.60908@redhat.com \
    --to=law@redhat.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).