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 <al...@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 via email to