Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-08-03 Thread Richard Sandiford via Gcc-patches
gt; 1; > +*/ > + > +int > +f (unsigned int *tmp) > +{ > + int sum = 0; > + for (int i = 0; i < 4; i++) > +sum += tmp[i]; > + > + return (unsigned int) sum >> 1; > +} > -- > 2.34.1 > > > From

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-08-03 Thread Hao Liu OS via Gcc-patches
t: Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625] Hi Richard, Update the patch with a simple case (see below case and comments). It shows a live stmt may not have reduction def, which introduce the ICE. Is it OK for trunk? Fix the assertion failu

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-08-01 Thread Hao Liu OS via Gcc-patches
lt; 4; i++) +sum += tmp[i]; + + return (unsigned int) sum >> 1; +} -- 2.34.1 From: Hao Liu OS Sent: Tuesday, August 1, 2023 17:43 To: Richard Sandiford Cc: Richard Biener; GCC-patches@gcc.gnu.org Subject: Re: [PATCH] AArch64: Do not increase the vect

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-08-01 Thread Hao Liu OS via Gcc-patches
-- 2.40.0 From: Richard Sandiford Sent: Monday, July 31, 2023 17:11 To: Hao Liu OS Cc: Richard Biener; GCC-patches@gcc.gnu.org Subject: Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625] Hao Liu OS writes: >> Which test case do you see this for

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-31 Thread Hao Liu OS via Gcc-patches
PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625] Hao Liu OS writes: >> Which test case do you see this for? The two tests in the patch still >> seem to report correct latencies for me if I make the change above. > > Not the newly added

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-31 Thread Richard Sandiford via Gcc-patches
Hao Liu OS writes: >> Which test case do you see this for? The two tests in the patch still >> seem to report correct latencies for me if I make the change above. > > Not the newly added tests. It is still the existing case causing the > previous ICE (i.e. assertion problem): gcc.target/aarch64

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-30 Thread Hao Liu OS via Gcc-patches
2023 1:35 To: Hao Liu OS Cc: Richard Biener; GCC-patches@gcc.gnu.org Subject: Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625] Sorry for the slow response. Hao Liu OS writes: >> Ah, thanks. In that case, Hao, I think we can avoid the ICE by

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-28 Thread Richard Sandiford via Gcc-patches
*/ > ops->reduction_latency = MAX (ops->reduction_latency, base * count); > else > ops->reduction_latency = MAX (ops->reduction_latency, base); > > Thanks, > Hao > > ________________ > From: Richard Sandiford > S

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-28 Thread Hao Liu OS via Gcc-patches
p; vect_is_reduction (stmt_info)) instead of using a null check. I see that vectorizable_reduction calculates a reduc_chain_length. Would it be OK to store that in the stmt_vec_info? I suppose the AArch64 code should be multiplying by that as well. (It would be a separate patch from this one th

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-26 Thread Hao Liu OS via Gcc-patches
s->reduction_latency, base * count); else ops->reduction_latency = MAX (ops->reduction_latency, base); Thanks, Hao From: Richard Sandiford Sent: Wednesday, July 26, 2023 17:14 To: Richard Biener Cc: Hao Liu OS; GCC-patches@gcc.gnu.org S

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-26 Thread Richard Biener via Gcc-patches
On Wed, Jul 26, 2023 at 12:12 PM Richard Sandiford wrote: > > Richard Biener writes: > > On Wed, Jul 26, 2023 at 11:14 AM Richard Sandiford > > wrote: > >> > >> Richard Biener writes: > >> > On Wed, Jul 26, 2023 at 4:02 AM Hao Liu OS via Gcc-patches > >> > wrote: > >> >> > >> >> > When was STM

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-26 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Wed, Jul 26, 2023 at 11:14 AM Richard Sandiford > wrote: >> >> Richard Biener writes: >> > On Wed, Jul 26, 2023 at 4:02 AM Hao Liu OS via Gcc-patches >> > wrote: >> >> >> >> > When was STMT_VINFO_REDUC_DEF empty? I just want to make sure that >> >> > we're not pape

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-26 Thread Richard Biener via Gcc-patches
educ_def != PHI_RESULT (reduc_def_phi)) loop. > I see that vectorizable_reduction calculates a reduc_chain_length. > Would it be OK to store that in the stmt_vec_info? I suppose the > AArch64 code should be multiplying by that as well. (It would be a > separate patch from this one though.) I don'

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-26 Thread Richard Sandiford via Gcc-patches
mp; vect_is_reduction (stmt_info)) instead of using a null check. I see that vectorizable_reduction calculates a reduc_chain_length. Would it be OK to store that in the stmt_vec_info? I suppose the AArch64 code should be multiplying by that as well. (It would be a separate patch from this one thoug

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-26 Thread Richard Biener via Gcc-patches
ing the reduction have STMT_VINFO_REDUC_DEF set, only the last (latch def) and live stmts have at the moment. Richard. > Thanks, > Hao > > ____________ > From: Richard Sandiford > Sent: Tuesday, July 25, 2023 17:44 > To: Hao Liu OS > Cc: GCC-patches@gcc.gnu.org > Subject: Re: [

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-25 Thread Hao Liu OS via Gcc-patches
VECTYPE (stmt_info): 0x0 Thanks, Hao From: Richard Sandiford Sent: Tuesday, July 25, 2023 17:44 To: Hao Liu OS Cc: GCC-patches@gcc.gnu.org Subject: Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625] Hao Liu OS writes: > Hi, > > Tha

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-25 Thread Richard Sandiford via Gcc-patches
Hao Liu OS writes: > Hi, > > Thanks for the suggestion. I tested it and found a gcc_assert failure: > gcc.target/aarch64/sve/cost_model_13.c (internal compiler error: in > info_for_reduction, at tree-vect-loop.cc:5473) > > It is caused by empty STMT_VINFO_REDUC_DEF. When was STMT_VINFO_REDU

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-25 Thread Hao Liu OS via Gcc-patches
ied by the count for + single_defuse_cycle. */ + +long +f (long res, short *ptr1, short *ptr2, int n) +{ + for (int i = 0; i < n; ++i) +res += (long) ptr1[i] << ptr2[i]; + return res; +} -- 2.34.1 ________ From: Richard Sandiford Sent: Monda

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-24 Thread Richard Sandiford via Gcc-patches
Hao Liu OS writes: > This only affects the new costs in aarch64 backend. Currently, the reduction > latency of vector body is too large as it is multiplied by stmt count. As the > scalar reduction latency is small, the new costs model may think "scalar code > would issue more quickly" and increa

Re: [PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-23 Thread Hao Liu OS via Gcc-patches
increase the vect reduction latency by multiplying count [PR110625] This only affects the new costs in aarch64 backend. Currently, the reduction latency of vector body is too large as it is multiplied by stmt count. As the scalar reduction latency is small, the new costs model may think "scalar

[PATCH] AArch64: Do not increase the vect reduction latency by multiplying count [PR110625]

2023-07-18 Thread Hao Liu OS via Gcc-patches
This only affects the new costs in aarch64 backend. Currently, the reduction latency of vector body is too large as it is multiplied by stmt count. As the scalar reduction latency is small, the new costs model may think "scalar code would issue more quickly" and increase the vector body cost a lo