From: Andrew MacLeod <amacleod@redhat.com>
To: Aldy Hernandez <aldyh@redhat.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Add stmt context in simplify_using_ranges.
Date: Wed, 30 Jun 2021 09:25:03 -0400 [thread overview]
Message-ID: <4cd93cc4-a55e-c134-972a-0e7f14417ec0@redhat.com> (raw)
In-Reply-To: <f1784256-2da6-b208-9c3d-7ab1b2fb4d66@redhat.com>
On 6/30/21 2:20 AM, Aldy Hernandez wrote:
>
>
> On 6/29/21 9:09 PM, Andrew MacLeod wrote:
>> We added context to a lot of simplify_using_ranges, but we didn't
>> catch all the places. This provides the originating stmt to the
>> missing cases which resolve a few EVRP testcases when running in
>> ranger-only mode.
>>
>> Bootstraps on x86_64-pc-linux-gnu with no regressions. Pushed.
>>
>> Andrew
>>
>>
>
> Thanks for doing this. I've done a half-assed job at passing context
> around; probably only when it yielded a discrepancy with evrp.
>
>>
>> bool
>> -simplify_using_ranges::op_with_boolean_value_range_p (tree op)
>> +simplify_using_ranges::op_with_boolean_value_range_p (tree op,
>> gimple *s)
>> {
>> if (TYPE_PRECISION (TREE_TYPE (op)) == 1)
>
> I know you like single letter arguments, but I find them confusing
> when the method is more than a few lines long. Besides, "stmt" is
> what is used throughout vr-values.c.
>
> And speaking of passing statements around, I wonder if it'd be best to
> have m_stmt and possible m_gsi as class fields. After all, we never
> change them, and they're used by most methods.
>
> Aldy
>
I think there's a revamp of simplify down the pipe anyway.
class simplify_using_ranges
{
public:
simplify_using_ranges (class range_query *query = NULL);
~simplify_using_ranges ();
void set_range_query (class range_query *q) { query = q; }
bool simplify (gimple_stmt_iterator *);
This is really the only external API.. the call to simplify. Long term
Im not sure that containing all the switch update management stuff att
he bottom of the class should be contained in this class.. That seems
like it should be a class that is used by simplifcation... and
simplification itself could be stateless.. kinda following the model
of fold_using_ranges.. the the gsi and stmt can be wrapped into a source
class if needed...
likewise we're eventually going to want to restructure the folding stuff
that happens.. but most of this can wait until evrp and vrp are gone,
then we can change the model a bit easier. bigger fish to fry and they
are already way better than they were before :-)
prev parent reply other threads:[~2021-06-30 13:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-29 19:09 Andrew MacLeod
2021-06-30 6:20 ` Aldy Hernandez
2021-06-30 13:25 ` Andrew MacLeod [this message]
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=4cd93cc4-a55e-c134-972a-0e7f14417ec0@redhat.com \
--to=amacleod@redhat.com \
--cc=aldyh@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/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).