From: Andrew MacLeod <amacleod@redhat.com>
To: Andrew Pinski <pinskia@gmail.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
Andrew Pinski <apinski@marvell.com>,
Aldy Hernandez <aldyh@redhat.com>,
gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 2/2] VR-VALUES: Rewrite test_for_singularity using range_op_handler
Date: Thu, 7 Sep 2023 10:02:51 -0400 [thread overview]
Message-ID: <937776ff-9497-f668-72dc-b36cc315939e@redhat.com> (raw)
In-Reply-To: <CA+=Sn1=KXOjCZNfjvv=7EUDt4ONay6zNaveAitA34o4d=GUjDQ@mail.gmail.com>
On 9/1/23 02:40, Andrew Pinski wrote:
> On Fri, Aug 11, 2023 at 8:08 AM Andrew MacLeod via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> If this is only going to work with integers, you might want to check
>> that somewhere or switch to irange and int_range_max..
>>
>> You can make it work with any kind (if you know op1 is a constant) by
>> simply doing
>>
>> Value_Range op1_range (TREE_TYPE (op1))
>> get_global_range_query->range_of_expr (op1_range, op1)
>>
>> That will convert trees to a the appropriate range... THis is also true
>> for integer constants... but you can also just do the WI conversion like
>> you do.
>>
>> The routine also get confusing to read because it passes in op0 and
>> op1, but of course ranger uses op1 and op2 nomenclature, and it looks a
>> bit confusing :-P I'd change the operands passed in to op1 and op2 if
>> we are rewriting the routine.
> Ranger using the nomenclature of op1/op2 and gimple is inconsistent
> with trees and other parts of GCC.
> It seems like we have to live with this inconsistency now too.
> Renaming things in this one function to op1/op2 might be ok but the
> rest of the file uses op0/op1 too; most likely because it was
> originally written before gimple.
>
> I think it would be good to have this written in the coding style,
> which way should we have it for new code; if we start at 0 or 1 for
> operands. It might reduce differences based on who wrote which part
> (and even to some extent when). I don't really care which one is
> picked as long as we pick one.
>
> Thanks,
> Andrew Pinski
>
I certainly wont argue it would be good to be consistent, but of course
its quite prevalent. Perhaps we should rewrite vr-values.cc to change
the terminology in one patch?
long term some of it is likely to get absorbed into rangeops, and what
isn't could/should be made vrange/irange aware... no one has gotten to
it yet. we could change the terminology as the routines are reworked too...
Andrew
next prev parent reply other threads:[~2023-09-07 14:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-08-11 9:50 ` [PATCH 1/2] PHI-OPT [PR 110984]: Add support for NE_EXPR/EQ_EXPR with casts to spaceship_replacement Richard Biener
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
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=937776ff-9497-f668-72dc-b36cc315939e@redhat.com \
--to=amacleod@redhat.com \
--cc=aldyh@redhat.com \
--cc=apinski@marvell.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=pinskia@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).