Fix a condition post r278611
diff mbox series

Message ID 384f1f8c-bc48-36fa-9f7d-aae99b6e846a@arm.com
State New
Headers show
Series
  • Fix a condition post r278611
Related show

Commit Message

Sudakshina Das Dec. 5, 2019, 2:30 p.m. UTC
Hi

While looking at vect_model_reduction_cost function, it seems Richard's 
change in a recent commit r278611 missed an update to the following if 
condition. Since the check for EXTRACT_LAST_REDUCTION is now split 
above, the same check in the if condition will never be true.

gcc/ChangeLog

2019-xx-xx  Sudakshina Das  <sudi.das@arm.com>

	* tree-vect-loop.c (vect_model_reduction_cost): Remove
	reduction_type check from if condition.

Is this ok for trunk?

Thanks
Sudi

Comments

Richard Sandiford Dec. 5, 2019, 5:04 p.m. UTC | #1
Sudakshina Das <Sudi.Das@arm.com> writes:
> Hi
>
> While looking at vect_model_reduction_cost function, it seems Richard's 
> change in a recent commit r278611 missed an update to the following if 
> condition. Since the check for EXTRACT_LAST_REDUCTION is now split 
> above, the same check in the if condition will never be true.
>
> gcc/ChangeLog
>
> 2019-xx-xx  Sudakshina Das  <sudi.das@arm.com>
>
> 	* tree-vect-loop.c (vect_model_reduction_cost): Remove
> 	reduction_type check from if condition.
>
> Is this ok for trunk?

OK, thanks.

Richard

>
> Thanks
> Sudi
>
> diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
> index ca8c818..7469204 100644
> --- a/gcc/tree-vect-loop.c
> +++ b/gcc/tree-vect-loop.c
> @@ -3933,7 +3933,7 @@ vect_model_reduction_cost (stmt_vec_info stmt_info, internal_fn reduc_fn,
>        /* No extra instructions needed in the prologue.  */
>        prologue_cost = 0;
>  
> -      if (reduction_type == EXTRACT_LAST_REDUCTION || reduc_fn != IFN_LAST)
> +      if (reduc_fn != IFN_LAST)
>  	/* Count one reduction-like operation per vector.  */
>  	inside_cost = record_stmt_cost (cost_vec, ncopies, vec_to_scalar,
>  					stmt_info, 0, vect_body);
Sudakshina Das Dec. 5, 2019, 6:04 p.m. UTC | #2
Hi Richard

On 05/12/2019 17:04, Richard Sandiford wrote:
> Sudakshina Das <Sudi.Das@arm.com> writes:
>> Hi
>>
>> While looking at vect_model_reduction_cost function, it seems Richard's
>> change in a recent commit r278611 missed an update to the following if
>> condition. Since the check for EXTRACT_LAST_REDUCTION is now split
>> above, the same check in the if condition will never be true.
>>
>> gcc/ChangeLog
>>
>> 2019-xx-xx  Sudakshina Das  <sudi.das@arm.com>
>>
>> 	* tree-vect-loop.c (vect_model_reduction_cost): Remove
>> 	reduction_type check from if condition.
>>
>> Is this ok for trunk?
> 
> OK, thanks.

Thanks. Committed as r279012.

Sudi

> 
> Richard
> 
>>
>> Thanks
>> Sudi
>>
>> diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
>> index ca8c818..7469204 100644
>> --- a/gcc/tree-vect-loop.c
>> +++ b/gcc/tree-vect-loop.c
>> @@ -3933,7 +3933,7 @@ vect_model_reduction_cost (stmt_vec_info stmt_info, internal_fn reduc_fn,
>>         /* No extra instructions needed in the prologue.  */
>>         prologue_cost = 0;
>>   
>> -      if (reduction_type == EXTRACT_LAST_REDUCTION || reduc_fn != IFN_LAST)
>> +      if (reduc_fn != IFN_LAST)
>>   	/* Count one reduction-like operation per vector.  */
>>   	inside_cost = record_stmt_cost (cost_vec, ncopies, vec_to_scalar,
>>   					stmt_info, 0, vect_body);

Patch
diff mbox series

diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ca8c818..7469204 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -3933,7 +3933,7 @@  vect_model_reduction_cost (stmt_vec_info stmt_info, internal_fn reduc_fn,
       /* No extra instructions needed in the prologue.  */
       prologue_cost = 0;
 
-      if (reduction_type == EXTRACT_LAST_REDUCTION || reduc_fn != IFN_LAST)
+      if (reduc_fn != IFN_LAST)
 	/* Count one reduction-like operation per vector.  */
 	inside_cost = record_stmt_cost (cost_vec, ncopies, vec_to_scalar,
 					stmt_info, 0, vect_body);