public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew MacLeod <amacleod@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/2] Implement generic expression evaluator for range_query.
Date: Thu, 3 Jun 2021 11:42:13 -0400	[thread overview]
Message-ID: <c7ccc05c-3c8a-44a5-c5b9-88c0453fe83e@redhat.com> (raw)
In-Reply-To: <CAGm3qMVgNxVxPqteCMsxjV=Ptmh2is1uZGhCtbL6p29uMC230g@mail.gmail.com>

On 6/3/21 11:39 AM, Aldy Hernandez via Gcc-patches wrote:
> Andrew had some minor suggestions and cleanups after I posted this.
>
> Andrew, is this what you had in mind?
>
> Aldy
>
> On Sat, May 29, 2021 at 6:06 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
>>
>>
>> On 5/27/2021 2:55 AM, Aldy Hernandez via Gcc-patches wrote:
>>> Right now, range_of_expr only works with constants, SSA names, and
>>> pointers.  Anything else gets returned as VARYING.  This patch adds the
>>> capability to deal with arbitrary expressions, inasmuch as these
>>> tree codes are implemented in range-ops.cc.
>>>
>>> This will give us the ability to ask for the range of any tree expression,
>>> not just constants and SSA names, with range_of_expr().
>>>
>>> This is a more generic implementation of determine_value_range in VRP.
>>> A follow-up patch will remove all uses of it in favor of the
>>> range_query API.
>>>
>>> Tested on x86-64 Linux.
>>>
>>> OK?
>>>
>>> gcc/ChangeLog:
>>>
>>>        * function-tests.c (test_ranges): Call gimple_range_tests.
>>>        * gimple-range-gori.cc (gori_compute::expr_range_at_stmt): Use
>>>        get_global_range_query instead of get_tree_range.
>>>        * gimple-range.cc (fur_source::get_operand): Add argument to
>>>        get_tree_range.
>>>        (get_arith_expr_range): New.
>>>        (get_tree_range): Add gimple and range_query arguments.
>>>        Call get_arith_expr_range.
>>>        (gimple_ranger::range_of_expr): Add argument to get_tree_range.
>>>        Include gimple-range-tests.cc.
>>>        * gimple-range.h (get_tree_range): Add argument.
>>>        * selftest.h (gimple_range_tests): New.
>>>        * value-query.cc (global_range_query::range_of_expr): Add
>>>        argument to get_tree_range.
>>>        * vr-values.c (vr_values::range_of_expr): Same.
>>>        * gimple-range-tests.cc: New file.
>> Both patches in this series are fine.
>>
>> Thanks,
>> Jeff
>>
yeah, OK.

Andrew


      reply	other threads:[~2021-06-03 15:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  8:55 Aldy Hernandez
2021-05-27  8:55 ` [PATCH 2/2] Replace uses of determine_value_range with range_of_expr Aldy Hernandez
2021-05-29  4:06 ` [PATCH 1/2] Implement generic expression evaluator for range_query Jeff Law
2021-06-03 15:39   ` Aldy Hernandez
2021-06-03 15:42     ` 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=c7ccc05c-3c8a-44a5-c5b9-88c0453fe83e@redhat.com \
    --to=amacleod@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).