public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, GCC] Fix a condition post r278611
@ 2019-12-05 14:30 Sudakshina Das
  2019-12-05 17:04 ` Richard Sandiford
  0 siblings, 1 reply; 3+ messages in thread
From: Sudakshina Das @ 2019-12-05 14:30 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Sandiford

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-cond.diff --]
[-- Type: text/x-patch; name="fix-cond.diff", Size: 604 bytes --]

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch, GCC] Fix a condition post r278611
  2019-12-05 14:30 [Patch, GCC] Fix a condition post r278611 Sudakshina Das
@ 2019-12-05 17:04 ` Richard Sandiford
  2019-12-05 18:04   ` Sudakshina Das
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2019-12-05 17:04 UTC (permalink / raw)
  To: Sudakshina Das; +Cc: gcc-patches

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch, GCC] Fix a condition post r278611
  2019-12-05 17:04 ` Richard Sandiford
@ 2019-12-05 18:04   ` Sudakshina Das
  0 siblings, 0 replies; 3+ messages in thread
From: Sudakshina Das @ 2019-12-05 18:04 UTC (permalink / raw)
  To: gcc-patches, Richard Sandiford

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);


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-05 18:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 14:30 [Patch, GCC] Fix a condition post r278611 Sudakshina Das
2019-12-05 17:04 ` Richard Sandiford
2019-12-05 18:04   ` Sudakshina Das

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).