public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>,
	Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	"hernandez, aldy" <aldyh@redhat.com>,
	Jakub Jelinek <jakub@redhat.com>,
	Jeff Law <jeffreyalaw@gmail.com>
Subject: Re: RFC - VRP1 default mode
Date: Fri, 28 Oct 2022 09:59:17 -0400	[thread overview]
Message-ID: <9588af4d-7c77-fad3-b845-9880139e28b1@redhat.com> (raw)
In-Reply-To: <CAFiYyc1anb8Rnr1aKkLaeyvr4kqqvvfv9kN=H=o_L6Gkqv9TpQ@mail.gmail.com>


On 10/28/22 09:46, Richard Biener wrote:
> On Fri, Oct 28, 2022 at 3:43 PM Andrew MacLeod <amacleod@redhat.com> wrote:
>>
>> On 10/28/22 03:17, Richard Biener wrote:
>>> On Wed, Oct 26, 2022 at 4:24 PM Andrew MacLeod <amacleod@redhat.com> wrote:
>>>> Figured I would ask what you guys think of making ranger the default for
>>>> the VRP1 pass now.
>>>>
>>>> With partial equivalences and the other bits I checked in the past few
>>>> weeks I'm not aware of much that the legacy VRP pass gets that ranger
>>>> doesn't.  The only exception to that which I am aware of is the trick
>>>> played with the unreachable edges to set global ranges, but that is done
>>>> in the DOM passes now anyway... so it just happens slightly later in the
>>>> optimization cycle.
>>> Note DOM should go away at some point.  Why can this not happen during
>>> ranger driven VRP?
>> I have been working on that for the last 2 days.  Turns out VRP1 can
>> remove builtin_unreachable from the
>>     if (X)
>>       __builtin_unreachable ()
>>
>> idiom and set the appropriate global ranges, but it has to leave those
>> with 2 ssa-names:
>>
>>     if (a_1 != b_2)
>>       __builtin_unreachable()
>>
>> until the second pass of VRP or we lose the relationship between a_1 and
>> b_2.  That triggers some failures.  Specifically a vectorizor fail
>> because it cant be sure that the start and end point are not the same
>> without the condition in the IL. Trying to store global relations over
>> multiple passes would be problematic at this stage of development, so I
>> don't see a problem with leaving it that way.
> Hmm, I don't remember VRP1 doing anything special with the above though?
> Did it somehow propagate the (un!)conditional equivalence?

So as I looked at builtin_unreachable(), it was very adhoc.  That one of 
the roots of that artificial testcase in the PR I opened. Cascading 
calls were not being handled in a consistent way. VRP1 removed some, dom 
removed some..  they just kind of disappeared at some point, but not 
consistently.  The PR that Uli opened that Aldy fixed, I could make fail 
again with minor adjustments to the conditions.  So I worked on a 
consistent approach.

My guess is the old range stored globally for that case for a_1 was 
probably ~[b_2, b_2]  meaning it was carried in the range. Until we have 
an overall global relation tracker, we can't represent that across passes.

It appears that leaving those until VRP2 works fine...  testsuite 
currently running tho ;-)

Andrew


  reply	other threads:[~2022-10-28 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 14:24 Andrew MacLeod
2022-10-26 14:59 ` Jeff Law
2022-10-28  7:17 ` Richard Biener
2022-10-28 13:43   ` Andrew MacLeod
2022-10-28 13:46     ` Richard Biener
2022-10-28 13:59       ` Andrew MacLeod [this message]
2022-10-28 14:14         ` Richard Biener
2022-10-28 14:33           ` Andrew MacLeod
2022-10-28 17:45     ` 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=9588af4d-7c77-fad3-b845-9880139e28b1@redhat.com \
    --to=amacleod@redhat.com \
    --cc=aldyh@redhat.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jeffreyalaw@gmail.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).