public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Andrew MacLeod <amacleod@redhat.com>, Andrew Pinski <pinskia@gmail.com>
Cc: Andrew Pinski <apinski@marvell.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 2/2] VR-VALUES: Rewrite test_for_singularity using range_op_handler
Date: Sat, 24 May 2025 08:46:37 -0600	[thread overview]
Message-ID: <ffff206e-2870-4c58-a29f-4e5d8c5b8121@gmail.com> (raw)
In-Reply-To: <6e0bd1a3-b2ba-43dc-adb5-82945f4a65f4@redhat.com>



On 5/23/25 8:56 AM, Andrew MacLeod wrote:

> Since the PR scrolled by, i don't think I ever noticed this thread.. or 
> at least where it lead.
> 
> This is not an "equivalence" that ranger would propagate because its a 
> relation with a constant.
> 
> the issue here seems to be:
> 
> if (x < 4)   when x has a range something like [0,0][10, 40][30, +INF]
> 
> on the true edge, we will propagate the RANGE [0,0] for x and any pass 
> which queries the range of x will get [0,0],  just as if if was if (x == 0)
> likewise, on the false edge we'll propagate x = [10,40][30, +INF]
> 
> so although we don't propagate an *equivalence* as such,  any pass which 
> queries the range of X will get the [0,0] range one expects.
Which is as good as propagation I think since a query for the range 
returns a singleton, so if we had a subsequent dest = a + x we'd 
simplify that to just dest = a.

> 
> As for the transformation...  Perhaps what we are really interested in 
> checking here is whether all further uses of x after this statement are 
> dominated by one edge of the condition, in which case you do the 
> transformation to the check for a singularity.     or you could check 
> that there are no dominated uses on the OTHER side of of the condition 
> that might utilize the lost information.. if no one used x on the false 
> side.. it doesn't matter.
I just think we want the transformation to go away.  The only thing we 
were trying to do was collapse it down to an EQ/NE so that we had an 
equivalence on one arm that could then be used to optimize code on that 
arm.  Ranger gives us that same capability without the undesirable side 
effects.

Jeff
> 
> Andrew
> 
> 


  reply	other threads:[~2025-05-24 14:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 17:30 [PATCH 1/2] VR-VALUES: Rename op0/op1 to op1/op2 for test_for_singularity Andrew Pinski
2023-09-01 17:30 ` [PATCH 2/2] VR-VALUES: Rewrite test_for_singularity using range_op_handler Andrew Pinski
2023-09-05  6:06   ` Jeff Law
2023-09-05  7:12     ` Andrew Pinski
2023-09-29 20:17       ` Jeff Law
2025-05-23 14:56         ` Andrew MacLeod
2025-05-24 14:46           ` Jeff Law [this message]
2023-09-05  5:56 ` [PATCH 1/2] VR-VALUES: Rename op0/op1 to op1/op2 for test_for_singularity Jeff Law
  -- strict thread matches above, loose matches on Subject: below --
2023-08-11  9:15 [PATCH 1/2] PHI-OPT [PR 110984]: Add support for NE_EXPR/EQ_EXPR with casts to spaceship_replacement Andrew Pinski
2023-08-11  9:15 ` [PATCH 2/2] VR-VALUES: Rewrite test_for_singularity using range_op_handler Andrew Pinski
2023-08-11  9:51   ` Richard Biener
2023-08-11 14:00     ` Jeff Law
2023-08-11 15:07     ` Andrew MacLeod
2023-08-21 21:00       ` Andrew Pinski
2023-09-01  6:40       ` Andrew Pinski
2023-09-07 14:02         ` Andrew MacLeod

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=ffff206e-2870-4c58-a29f-4e5d8c5b8121@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=amacleod@redhat.com \
    --cc=apinski@marvell.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@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).