Re: PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-18 Thread Prathamesh Kulkarni
On Wed, 18 Oct 2023 at 23:22, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 17 Oct 2023 at 02:40, Richard Sandiford > > wrote: > >> Prathamesh Kulkarni writes: > >> > diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc > >> > index 4f8561509ff..55a6a68c16c 100644 > >> > --

Re: PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-18 Thread Richard Sandiford
Prathamesh Kulkarni writes: > On Tue, 17 Oct 2023 at 02:40, Richard Sandiford > wrote: >> Prathamesh Kulkarni writes: >> > diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc >> > index 4f8561509ff..55a6a68c16c 100644 >> > --- a/gcc/fold-const.cc >> > +++ b/gcc/fold-const.cc >> > @@ -10684,9 +106

Re: PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-17 Thread Prathamesh Kulkarni
= 1 > >> > > > which seems to fix the issue by encoding all the elements. > >> > > > > >> > > > The patch resulted in Case 4 and Case 5 failing from > >> > > > test_nunits_min_2 because > >> > > > the

Re: PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-16 Thread Richard Sandiford
_pattern = 1 >> > > > which seems to fix the issue by encoding all the elements. >> > > > >> > > > The patch resulted in Case 4 and Case 5 failing from test_nunits_min_2 >> > > > because >> > > > they used sel = { 0, 0,

Re: PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-12 Thread Prathamesh Kulkarni
; > > because > > > > they used sel = { 0, 0, 1, ... } and {len, 0, 1, ... } respectively, > > > > which used a1 = 0, and thus selected arg1[0]. > > > > > > > > I removed Case 4 because it was already covered in test_nunits_min_4, > > >

Re: PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-11 Thread Prathamesh Kulkarni
nunits_min_2 > > > because > > > they used sel = { 0, 0, 1, ... } and {len, 0, 1, ... } respectively, > > > which used a1 = 0, and thus selected arg1[0]. > > > > > > I removed Case 4 because it was already covered in test_nunits_min_4, > > > and moved

Re: PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-11 Thread Prathamesh Kulkarni
t_nunits_min_4, with sel = { len, 1, 2, ... } > > and added a new Case 9 to test for this issue. > > > > Passes bootstrap+test on aarch64-linux-gnu with and without SVE, > > and on x86_64-linux-gnu. > > Does the patch look OK ? > > > > Thanks, > > Prathamesh > >

Re: PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-09 Thread Richard Sandiford
test_nunits_min_4, with sel = { len, 1, 2, ... } > and added a new Case 9 to test for this issue. > > Passes bootstrap+test on aarch64-linux-gnu with and without SVE, > and on x86_64-linux-gnu. > Does the patch look OK ? > > Thanks, > Prathamesh >

PR111648: Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding

2023-10-04 Thread Prathamesh Kulkarni
, Prathamesh [PR111648] Fix wrong code-gen due to incorrect VEC_PERM_EXPR folding. gcc/ChangeLog: PR tree-optimization/111648 * fold-const.cc (valid_mask_for_fold_vec_perm_cst_p): Punt if a1 is a multiple of vector length. (test_nunits_min_2): Remove Case 4 and move Case 5 to