>> OK. Thanks. Committed. >> Note load/store-lanes is specifically pre-empting SLP if all >> loads/stores of a SLP intance can support that. Not sure if this >> heuristic is good for load/store lanes with high stride?
Yeah, I understand your concern. Emmmmm, I am sure too. But RVV ISA define lanes load/store from 2 to 8 and LLVM already supported. I think we can fully support them, then let RISC-V COST model decide it whether it is profitable or not. Also, I found RVV can vectorize a TSVC case with stride = 5 lane_load/lane_store: tsvc-s353.c: -/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail { ! riscv_v } } } } */ https://gcc.gnu.org/pipermail/gcc-patches/2023-October/632213.html So, I think overall it is beneficial we support high stride lane load/store which can help us vectorize more cases. juzhe.zh...@rivai.ai From: Richard Biener Date: 2023-10-09 20:41 To: Juzhe-Zhong CC: gcc-patches; jeffreyalaw Subject: Re: [PATCH] RISC-V Regression test: Fix FAIL of fast-math-slp-38.c for RVV On Mon, 9 Oct 2023, Juzhe-Zhong wrote: > Reference: https://godbolt.org/z/G9jzf5Grh > > RVV is able to vectorize this case using SLP. However, with > -fno-vect-cost-model, RVV vectorize it by vec_load_lanes with stride 6. OK. Note load/store-lanes is specifically pre-empting SLP if all loads/stores of a SLP intance can support that. Not sure if this heuristic is good for load/store lanes with high stride? > gcc/testsuite/ChangeLog: > > * gcc.dg/vect/fast-math-slp-38.c: Add ! vect_strided6. > > --- > gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > index 7c7acd5bab6..96751faae7f 100644 > --- a/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > +++ b/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c > @@ -18,4 +18,4 @@ foo (void) > } > > /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ > -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" > } } */ > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" > { target { ! vect_strided6 } } } } */ > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)