public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Aldy Hernandez <aldyh@redhat.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: value_range_base::{non_zero_p, set_zero, set_non_zero}
Date: Fri, 31 May 2019 00:08:00 -0000	[thread overview]
Message-ID: <3113ceee-af0b-3f63-797f-6983da829621@redhat.com> (raw)
In-Reply-To: <af11453b-e355-2896-2cff-8164c44630d1@redhat.com>

On 5/30/19 12:58 AM, Aldy Hernandez wrote:
> Hi.
> 
> We have zero_p in the API, but we don't have non_zero_p.  Instead we use
> a non-API function range_is_nonnull.  I've fixed this.
> 
> I have also gotten rid of the duplicity of using the non-API
> range_is_null in favor of value_range_base::zero_p().
> 
> Furthermore, there's value_range*::set_null and
> value_range*::set_nonnull().  It's inconsistent to use null/nonnull as
> well as zero/non_zero throughout.  I've moved everything to *zero.
> 
> Finally, it seems to me that the derived value_range versions of
> set_*zero/null are a bit confusing in that they clear equivalences
> behind the scenes.  There's no intuitive reason why setting a range of
> [0,0] versus [5,10] should clear equivalences.  I've made the
> equivalence nuking explicit in the handful of places where we do this,
> and thus reduced the need for separate value_range versions.
> 
> I believe with these changes, as well as the pending intersect patch,
> we've cleaned up the remaining value_range uses where we actually wanted
> to use value_range_base.  Or at least the remaining "value_range tem"
> business.
> 
> OK?
> 
> Aldy
> 
> curr.patch
> 
> commit 55294d340a0727dbe985ee4bf3c1969a19bcbe6d
> Author: Aldy Hernandez <aldyh@redhat.com>
> Date:   Tue May 28 19:30:31 2019 +0200
> 
>             * tree-vrp.h (value_range_base::non_zero_p): New.
>             (value_range_base::set_nonnull): Rename to...
>             (value_range_base::set_non_zero): ...this.
>             (value_range_base::set_null): Rename to...
>             (value_range_base::set_zero): ...this.
>             (value_range::set_nonnull): Remove.
>             (value_range::set_null): Remove.
>             * tree-vrp.c (range_is_null): Remove.
>             (range_is_nonnull): Remove.
>             (extract_range_from_binary_expr): Use value_range_base::*zero_p
>             instead of range_is_*null.
>             (extract_range_from_unary_expr): Same.
>             (value_range_base::set_nonnull): Rename to...
>             (value_range_base::set_non_zero): ...this.
>             (value_range::set_nonnull): Remove.
>             (value_range_base::set_null): Rename to...
>             (value_range_base::set_zero): ...this.
>             (value_range::set_null): Remove.
>             (extract_range_from_binary_expr): Rename set_*null uses to
>             set_*zero.
>             (extract_range_from_unary_expr): Same.
>             (union_helper): Same.
>             * vr-values.c (get_value_range): Use set_*zero instead of
>             set_*null.
>             (vr_values::extract_range_from_binary_expr): Same.
>             (vr_values::extract_range_basic): Same.
> 
OK
jeff


  reply	other threads:[~2019-05-30 23:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30  7:49 Aldy Hernandez
2019-05-31  0:08 ` Jeff Law [this message]
2019-05-31  0:59 ` Martin Sebor
2019-05-31  1:44   ` Joseph Myers
2019-05-31  9:05   ` Aldy Hernandez

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=3113ceee-af0b-3f63-797f-6983da829621@redhat.com \
    --to=law@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).