Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-16 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 16 Aug 2023 at 15:21, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > >> Unfortunately, the patch regressed following tests on ppc64le and > >> armhf respectively: > >> gcc.target/powerpc/vec-perm-ctor.c scan-tree-dump-not optimized > >> "VIEW_CONVERT_EXPR" > >>

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-16 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: >> Unfortunately, the patch regressed following tests on ppc64le and >> armhf respectively: >> gcc.target/powerpc/vec-perm-ctor.c scan-tree-dump-not optimized >> "VIEW_CONVERT_EXPR" >> gcc.dg/tree-ssa/forwprop-20.c scan-tree-dump-not forwprop1 "VEC_PERM_EXPR" >> >>

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-16 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 15 Aug 2023 at 16:59, Prathamesh Kulkarni wrote: > > On Mon, 14 Aug 2023 at 18:23, Richard Sandiford > wrote: > > > > Prathamesh Kulkarni writes: > > > On Thu, 10 Aug 2023 at 21:27, Richard Sandiford > > > wrote: > > >> > > >> Prathamesh Kulkarni writes: > > >> >> static bool > > >>

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-15 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 14 Aug 2023 at 18:23, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Thu, 10 Aug 2023 at 21:27, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> >> static bool > >> >> is_simple_vla_size (poly_uint64 size) > >> >> { > >> >> if (size.is_constant

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-14 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Thu, 10 Aug 2023 at 21:27, Richard Sandiford > wrote: >> >> Prathamesh Kulkarni writes: >> >> static bool >> >> is_simple_vla_size (poly_uint64 size) >> >> { >> >> if (size.is_constant ()) >> >> return false; >> >> for (int i = 1; i < ARRAY_SIZE

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-13 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 10 Aug 2023 at 21:27, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > >> static bool > >> is_simple_vla_size (poly_uint64 size) > >> { > >> if (size.is_constant ()) > >> return false; > >> for (int i = 1; i < ARRAY_SIZE (size.coeffs); ++i) > >> if (size[i] != (i <=

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-10 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: >> static bool >> is_simple_vla_size (poly_uint64 size) >> { >> if (size.is_constant ()) >> return false; >> for (int i = 1; i < ARRAY_SIZE (size.coeffs); ++i) >> if (size[i] != (i <= 1 ? size[0] : 0)) > Just wondering is this should be (i == 1 ? size[0] :

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-10 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 8 Aug 2023 at 15:27, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Fri, 4 Aug 2023 at 20:36, Richard Sandiford > > wrote: > >> > >> Full review this time, sorry for the skipping the tests earlier. > > Thanks for the detailed review! Please find my responses inline

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-08 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Fri, 4 Aug 2023 at 20:36, Richard Sandiford > wrote: >> >> Full review this time, sorry for the skipping the tests earlier. > Thanks for the detailed review! Please find my responses inline below. >> >> Prathamesh Kulkarni writes: >> > diff --git

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-06 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 4 Aug 2023 at 20:36, Richard Sandiford wrote: > > Full review this time, sorry for the skipping the tests earlier. Thanks for the detailed review! Please find my responses inline below. > > Prathamesh Kulkarni writes: > > diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc > > index

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-04 Thread Richard Sandiford via Gcc-patches
Full review this time, sorry for the skipping the tests earlier. Prathamesh Kulkarni writes: > diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc > index 7e5494dfd39..680d0e54fd4 100644 > --- a/gcc/fold-const.cc > +++ b/gcc/fold-const.cc > @@ -85,6 +85,10 @@ along with GCC; see the file

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-04 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 3 Aug 2023 at 18:46, Richard Sandiford wrote: > > Richard Sandiford writes: > > Prathamesh Kulkarni writes: > >> On Tue, 25 Jul 2023 at 18:25, Richard Sandiford > >> wrote: > >>> > >>> Hi, > >>> > >>> Thanks for the rework and sorry for the slow review. > >> Hi Richard, > >> Thanks for

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-03 Thread Richard Sandiford via Gcc-patches
Richard Sandiford writes: > Prathamesh Kulkarni writes: >> On Tue, 25 Jul 2023 at 18:25, Richard Sandiford >> wrote: >>> >>> Hi, >>> >>> Thanks for the rework and sorry for the slow review. >> Hi Richard, >> Thanks for the suggestions! Please find my responses inline below. >>> >>> Prathamesh

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-03 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Tue, 25 Jul 2023 at 18:25, Richard Sandiford > wrote: >> >> Hi, >> >> Thanks for the rework and sorry for the slow review. > Hi Richard, > Thanks for the suggestions! Please find my responses inline below. >> >> Prathamesh Kulkarni writes: >> > Hi Richard, >> >

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-07-28 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 25 Jul 2023 at 18:25, Richard Sandiford wrote: > > Hi, > > Thanks for the rework and sorry for the slow review. Hi Richard, Thanks for the suggestions! Please find my responses inline below. > > Prathamesh Kulkarni writes: > > Hi Richard, > > This is reworking of patch to extend

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-07-25 Thread Richard Sandiford via Gcc-patches
Hi, Thanks for the rework and sorry for the slow review. Prathamesh Kulkarni writes: > Hi Richard, > This is reworking of patch to extend fold_vec_perm to handle VLA vectors. > The attached patch unifies handling of VLS and VLA vector_csts, while > using fallback code > for ctors. > > For VLS

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-07-25 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 17 Jul 2023 at 17:44, Prathamesh Kulkarni wrote: > > Hi Richard, > This is reworking of patch to extend fold_vec_perm to handle VLA vectors. > The attached patch unifies handling of VLS and VLA vector_csts, while > using fallback code > for ctors. > > For VLS vector, the patch ignores

[RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-07-17 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, This is reworking of patch to extend fold_vec_perm to handle VLA vectors. The attached patch unifies handling of VLS and VLA vector_csts, while using fallback code for ctors. For VLS vector, the patch ignores underlying encoding, and uses npatterns = nelts, and nelts_per_pattern = 1.