diff mbox series

[PUSHED,5/8] Adjust vrp_evaluate_conditional for irange API.

Message ID 20200804063441.517123-6-aldyh@redhat.com
State New
Headers show
Series irange API adjustments for various files | expand

Commit Message

Aldy Hernandez Aug. 4, 2020, 6:34 a.m. UTC
VR_RANGE of [-INF,+INF] is canonicalized to VARYING at creation.
That is why the test now becomes varying_p().

gcc/ChangeLog:

	* vr-values.c (simplify_using_ranges::vrp_evaluate_conditional): Adjust
	for irange API.
---
 gcc/vr-values.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Richard Biener Aug. 4, 2020, 6:55 a.m. UTC | #1
On Tue, Aug 4, 2020 at 8:40 AM Aldy Hernandez via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> VR_RANGE of [-INF,+INF] is canonicalized to VARYING at creation.
> That is why the test now becomes varying_p().
>
> gcc/ChangeLog:
>
>         * vr-values.c (simplify_using_ranges::vrp_evaluate_conditional): Adjust
>         for irange API.
> ---
>  gcc/vr-values.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/gcc/vr-values.c b/gcc/vr-values.c
> index 1190fa96453..90ba8fca246 100644
> --- a/gcc/vr-values.c
> +++ b/gcc/vr-values.c
> @@ -2495,11 +2495,7 @@ simplify_using_ranges::vrp_evaluate_conditional (tree_code code, tree op0,
>        tree type = TREE_TYPE (op0);
>        const value_range_equiv *vr0 = get_value_range (op0);
>
> -      if (vr0->kind () == VR_RANGE
> -         && INTEGRAL_TYPE_P (type)
> -         && vrp_val_is_min (vr0->min ())
> -         && vrp_val_is_max (vr0->max ())
> -         && is_gimple_min_invariant (op1))
> +      if (vr0->varying_p () && INTEGRAL_TYPE_P (type))

You dropped the is_gimple_min_invariant (op1) check.

>         {
>           location_t location;
>
> --
> 2.26.2
>
Aldy Hernandez Aug. 4, 2020, 9:23 a.m. UTC | #2
On 8/4/20 8:55 AM, Richard Biener wrote:
> On Tue, Aug 4, 2020 at 8:40 AM Aldy Hernandez via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> VR_RANGE of [-INF,+INF] is canonicalized to VARYING at creation.
>> That is why the test now becomes varying_p().
>>
>> gcc/ChangeLog:
>>
>>          * vr-values.c (simplify_using_ranges::vrp_evaluate_conditional): Adjust
>>          for irange API.
>> ---
>>   gcc/vr-values.c | 6 +-----
>>   1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/gcc/vr-values.c b/gcc/vr-values.c
>> index 1190fa96453..90ba8fca246 100644
>> --- a/gcc/vr-values.c
>> +++ b/gcc/vr-values.c
>> @@ -2495,11 +2495,7 @@ simplify_using_ranges::vrp_evaluate_conditional (tree_code code, tree op0,
>>         tree type = TREE_TYPE (op0);
>>         const value_range_equiv *vr0 = get_value_range (op0);
>>
>> -      if (vr0->kind () == VR_RANGE
>> -         && INTEGRAL_TYPE_P (type)
>> -         && vrp_val_is_min (vr0->min ())
>> -         && vrp_val_is_max (vr0->max ())
>> -         && is_gimple_min_invariant (op1))
>> +      if (vr0->varying_p () && INTEGRAL_TYPE_P (type))
> 
> You dropped the is_gimple_min_invariant (op1) check.

Ah, thanks.

Pushed the attached patch.

Aldy
diff mbox series

Patch

diff --git a/gcc/vr-values.c b/gcc/vr-values.c
index 1190fa96453..90ba8fca246 100644
--- a/gcc/vr-values.c
+++ b/gcc/vr-values.c
@@ -2495,11 +2495,7 @@  simplify_using_ranges::vrp_evaluate_conditional (tree_code code, tree op0,
       tree type = TREE_TYPE (op0);
       const value_range_equiv *vr0 = get_value_range (op0);
 
-      if (vr0->kind () == VR_RANGE
-	  && INTEGRAL_TYPE_P (type)
-	  && vrp_val_is_min (vr0->min ())
-	  && vrp_val_is_max (vr0->max ())
-	  && is_gimple_min_invariant (op1))
+      if (vr0->varying_p () && INTEGRAL_TYPE_P (type))
 	{
 	  location_t location;