[aarch64] Use force_reg instead of copy_to_mode_reg

2023-04-21 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, Based on your suggestions in the other thread, the patch uses force_reg to avoid creating pseudo if value is already in a register. Bootstrap+test passes on aarch64-linux-gnu. OK to commit ? Thanks, Prathamesh [aarch64] Use force_reg instead of copy_to_mode_reg. Use force_reg instead

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-04-21 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 21 Apr 2023 at 14:47, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi, > > I tested the interleave+zip1 for vector init patch and it segfaulted > > during bootstrap while trying to build > > libgfortran/generated/matmul_i2.c. > > R

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-04-21 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 12 Apr 2023 at 14:29, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Thu, 6 Apr 2023 at 16:05, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 4 Apr 2023 at 23:35, Richard Sandiford

Re: [match.pd] [SVE] Add pattern to transform svrev(svrev(v)) --> v

2023-04-19 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 19 Apr 2023 at 16:17, Richard Biener wrote: > > On Wed, Apr 19, 2023 at 11:21 AM Prathamesh Kulkarni > wrote: > > > > On Tue, 11 Apr 2023 at 19:36, Prathamesh Kulkarni > > wrote: > > > > > > On Tue, 11 Apr 2023 at 14:17, Richard Biener >

Re: [match.pd] [SVE] Add pattern to transform svrev(svrev(v)) --> v

2023-04-19 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 11 Apr 2023 at 19:36, Prathamesh Kulkarni wrote: > > On Tue, 11 Apr 2023 at 14:17, Richard Biener > wrote: > > > > On Wed, Apr 5, 2023 at 10:39 AM Prathamesh Kulkarni via Gcc-patches > > wrote: > > > > > > Hi, > > > For t

Re: [aarch64] Use wzr/xzr for assigning vector element to 0

2023-04-19 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 31 Jan 2023 at 11:51, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Mon, 23 Jan 2023 at 22:26, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Wed, 18 Jan 2023 at 19:59, Richard Sandiford &g

Re: [match.pd] [SVE] Add pattern to transform svrev(svrev(v)) --> v

2023-04-11 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 11 Apr 2023 at 14:17, Richard Biener wrote: > > On Wed, Apr 5, 2023 at 10:39 AM Prathamesh Kulkarni via Gcc-patches > wrote: > > > > Hi, > > For the following test: > > > > svint32_t f(svint32_t v) > > { > > return svrev_s32 (svrev_s32

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-04-06 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 6 Apr 2023 at 16:05, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 4 Apr 2023 at 23:35, Richard Sandiford > > wrote: > >> > diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc > >> > b/gcc/config/aarch64

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-04-06 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 4 Apr 2023 at 23:35, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Mon, 13 Mar 2023 at 13:03, Richard Biener wrote: > >> On GIMPLE it would be > >> > >> _1 = { a, ... }; // (a) > >> _2 = { _1, ... }; // (b) > >

[match.pd] [SVE] Add pattern to transform svrev(svrev(v)) --> v

2023-04-05 Thread Prathamesh Kulkarni via Gcc-patches
Hi, For the following test: svint32_t f(svint32_t v) { return svrev_s32 (svrev_s32 (v)); } We generate 2 rev instructions instead of nop: f: rev z0.s, z0.s rev z0.s, z0.s ret The attached patch tries to fix that by trying to recognize the following pattern in

Re: [aarch64] Code-gen for vector initialization involving constants

2023-04-03 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 13 Feb 2023 at 11:58, Prathamesh Kulkarni wrote: > > On Fri, 3 Feb 2023 at 12:46, Prathamesh Kulkarni > wrote: > > > > Hi Richard, > > While digging thru aarch64_expand_vector_init, I noticed it gives > > priority to loading a constant first: > >

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-04-03 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 13 Mar 2023 at 13:03, Richard Biener wrote: > > On Fri, 10 Mar 2023, Richard Sandiford wrote: > > > Sorry for the slow reply. > > > > Prathamesh Kulkarni writes: > > > Unfortunately it regresses code-gen for the following case: > > > > >

Re: RISC-V: Add divmod instruction support

2023-02-18 Thread Prathamesh Kulkarni via Gcc-patches
On Sun, 19 Feb 2023 at 01:01, Maciej W. Rozycki wrote: > > On Sat, 18 Feb 2023, Andrew Pinski via Gcc-patches wrote: > > > > > If we have division and remainder calculations with the same operands: > > > > > > > > a = b / c; > > > > d = b % c; > > > > > > > > We can replace the calculation of

Re: [aarch64] Code-gen for vector initialization involving constants

2023-02-12 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 3 Feb 2023 at 12:46, Prathamesh Kulkarni wrote: > > Hi Richard, > While digging thru aarch64_expand_vector_init, I noticed it gives > priority to loading a constant first: > /* Initialise a vector which is part-variable. We want to first try > to build

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-02-11 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 6 Feb 2023 at 17:43, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Fri, 3 Feb 2023 at 20:47, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Fri, 3 Feb 2023 at 07:10, Prathamesh Kulkarni &

Re: [DOC PATCH] Document the VEC_PERM_EXPR tree code (and minor clean-ups).

2023-02-07 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 6 Feb 2023 at 20:14, Roger Sayle wrote: > > > Perhaps I'm missing something (I'm not too familiar with SVE semantics), but > is there > a reason that the solution for PR96473 uses a VEC_PERM_EXPR and not just a > VEC_DUPLICATE_EXPR? The folding of sv1d1rq (svptrue_..., ...) doesn't seem

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-02-03 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 3 Feb 2023 at 20:47, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Fri, 3 Feb 2023 at 07:10, Prathamesh Kulkarni > > wrote: > >> > >> On Thu, 2 Feb 2023 at 20:50, Richard Sandiford > >> wrote: > >> > > >

[aarch64] Code-gen for vector initialization involving constants

2023-02-02 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, While digging thru aarch64_expand_vector_init, I noticed it gives priority to loading a constant first: /* Initialise a vector which is part-variable. We want to first try to build those lanes which are constant in the most efficient way we can. */ which results in

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-02-02 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 3 Feb 2023 at 07:10, Prathamesh Kulkarni wrote: > > On Thu, 2 Feb 2023 at 20:50, Richard Sandiford > wrote: > > > > Prathamesh Kulkarni writes: > > >> >> > I have attached a patch that extends the transform if one half is > > >&

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-02-02 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 2 Feb 2023 at 20:50, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > >> >> > I have attached a patch that extends the transform if one half is dup > >> >> > and other is set of constants. > >> >> > For eg: &g

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-02-02 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 1 Feb 2023 at 21:56, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Thu, 12 Jan 2023 at 21:21, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 6 Dec 2022 at 07:01, Prathamesh Kulkarni &

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2023-02-01 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 17 Jan 2023 at 17:24, Prathamesh Kulkarni wrote: > > On Mon, 26 Dec 2022 at 09:56, Prathamesh Kulkarni > wrote: > > > > On Tue, 13 Dec 2022 at 11:35, Prathamesh Kulkarni > > wrote: > > > > > > On Tue, 6 Dec 2022 at 21:00, Richard Sandi

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2023-02-01 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 12 Jan 2023 at 21:21, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 6 Dec 2022 at 07:01, Prathamesh Kulkarni > > wrote: > >> > >> On Mon, 5 Dec 2022 at 16:50, Richard Sandiford > >> wrote: > >&

Re: [aarch64] Use wzr/xzr for assigning vector element to 0

2023-01-25 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 23 Jan 2023 at 22:26, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Wed, 18 Jan 2023 at 19:59, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 17 Jan 2023 at 18:29, Richard Sandiford &g

Re: [aarch64] Use wzr/xzr for assigning vector element to 0

2023-01-19 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 18 Jan 2023 at 19:59, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 17 Jan 2023 at 18:29, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > Hi Richard, > >> > For the fo

Re: [aarch64] Use exact_log2 (INTVAL (operands[2])) >= 0 to gate for vec_merge patterns.

2023-01-18 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 18 Jan 2023 at 20:00, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > Based on your suggestion in the other thread, the patch uses > > exact_log2 (INTVAL (operands[2])) >= 0 to gate for vec_merge patterns. > > Bootstrap+test

[aarch64] Use exact_log2 (INTVAL (operands[2])) >= 0 to gate for vec_merge patterns.

2023-01-18 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, Based on your suggestion in the other thread, the patch uses exact_log2 (INTVAL (operands[2])) >= 0 to gate for vec_merge patterns. Bootstrap+test in progress on aarch64-linux-gnu. Does it look OK ? Thanks, Prathamesh [aarch64] Use exact_log2 (INTVAL (operands[2])) >= 0 to gate for

Re: [aarch64] Use wzr/xzr for assigning vector element to 0

2023-01-18 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 17 Jan 2023 at 18:29, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > For the following (contrived) test: > > > > void foo(int32x4_t v) > > { > > v[3] = 0; > > return v; > > } > > > >

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2023-01-17 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 26 Dec 2022 at 09:56, Prathamesh Kulkarni wrote: > > On Tue, 13 Dec 2022 at 11:35, Prathamesh Kulkarni > wrote: > > > > On Tue, 6 Dec 2022 at 21:00, Richard Sandiford > > wrote: > > > > > > Prathamesh Kulkarni via Gcc-patches writes: &g

[aarch64] Use wzr/xzr for assigning vector element to 0

2023-01-17 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, For the following (contrived) test: void foo(int32x4_t v) { v[3] = 0; return v; } -O2 code-gen: foo: fmovs1, wzr ins v0.s[3], v1.s[0] ret I suppose we can instead emit the following code-gen ? foo: ins v0.s[3], wzr ret combine produces:

Re: Missed lowering to ld1rq from svld1rq for memory operand

2023-01-14 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 12 Jan 2023 at 21:02, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Fri, 5 Aug 2022 at 17:49, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > Hi Richard, > >> > Follow

Re: Missed lowering to ld1rq from svld1rq for memory operand

2023-01-10 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 5 Aug 2022 at 17:49, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > Following from off-list discussion, in the attached patch, I wrote pattern > > similar to vec_duplicate_reg, which seems to work for the svld1rq > &

Re: [Bug c/108224] [PATCH] add srandom random initstate setstate

2022-12-31 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 28 Dec 2022 at 04:01, Jonny Grant wrote: > > > > On 26/12/2022 09:19, Prathamesh Kulkarni wrote: > > On Mon, 26 Dec 2022 at 14:25, Jonny Grant wrote: > >> > >> > >> > >> From 6ff344979af46dbcd739dd9068d6d595547e4c27 Mon Sep 17 00:00

Re: [Bug c/108224] [PATCH] add srandom random initstate setstate

2022-12-26 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 26 Dec 2022 at 14:25, Jonny Grant wrote: > > > > From 6ff344979af46dbcd739dd9068d6d595547e4c27 Mon Sep 17 00:00:00 2001 > From: Jonathan Grant > Date: Sun, 25 Dec 2022 22:38:44 + > Subject: [PATCH] add srandom random initstate setstate > > --- > gcc/c-family/known-headers.cc | 4

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-12-25 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 13 Dec 2022 at 11:35, Prathamesh Kulkarni wrote: > > On Tue, 6 Dec 2022 at 21:00, Richard Sandiford > wrote: > > > > Prathamesh Kulkarni via Gcc-patches writes: > > > On Fri, 4 Nov 2022 at 14:00, Prathamesh Kulkarni > > > wrote: > > &g

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2022-12-25 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 6 Dec 2022 at 07:01, Prathamesh Kulkarni wrote: > > On Mon, 5 Dec 2022 at 16:50, Richard Sandiford > wrote: > > > > Richard Sandiford via Gcc-patches writes: > > > Prathamesh Kulkarni writes: > > >> Hi, > > >> For the following tes

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-12-12 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 6 Dec 2022 at 21:00, Richard Sandiford wrote: > > Prathamesh Kulkarni via Gcc-patches writes: > > On Fri, 4 Nov 2022 at 14:00, Prathamesh Kulkarni > > wrote: > >> > >> On Mon, 31 Oct 2022 at 15:27, Richard Sandiford > >> wrote: > >>

Re: [aarch64] PR107920 - Fix incorrect handling of virtual operands in svld1rq_impl::fold

2022-12-05 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 6 Dec 2022 at 00:08, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi, > > The following test: > > > > #include "arm_sve.h" > > > > svint8_t > > test_s8(int8_t *x) > > { > > return svld1rq_s8 (svptr

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2022-12-05 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 5 Dec 2022 at 16:50, Richard Sandiford wrote: > > Richard Sandiford via Gcc-patches writes: > > Prathamesh Kulkarni writes: > >> Hi, > >> For the following test-case: > >> > >> int16x8_t foo(int16_t x, int16_t y) > >

Re: [PATCH] tree, c++: optimize walk_tree_1 and cp_walk_subtrees

2022-12-05 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 5 Dec 2022 at 09:51, Patrick Palka via Gcc-patches wrote: > > These functions currently repeatedly dereference tp during the subtree > walk, dereferences which the compiler can't CSE because it can't > guarantee that the subtree walking doesn't modify *tp. > > But we already implicitly

[aarch64] PR107920 - Fix incorrect handling of virtual operands in svld1rq_impl::fold

2022-12-01 Thread Prathamesh Kulkarni via Gcc-patches
Hi, The following test: #include "arm_sve.h" svint8_t test_s8(int8_t *x) { return svld1rq_s8 (svptrue_b8 (), [0]); } ICE's with -march=armv8.2-a+sve -O1 -fno-tree-ccp -fno-tree-forwprop: during GIMPLE pass: fre pr107920.c: In function ‘test_s8’: pr107920.c:7:1: internal compiler error: in

Re: [aarch64] Use dup and zip1 for interleaving elements in initializing vector

2022-11-29 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 29 Nov 2022 at 20:43, Andrew Pinski wrote: > > On Tue, Nov 29, 2022 at 6:40 AM Prathamesh Kulkarni via Gcc-patches > wrote: > > > > Hi, > > For the following test-case: > > > > int16x8_t foo(int16_t x, int16_t y) > > { >

[aarch64] Use dup and zip1 for interleaving elements in initializing vector

2022-11-29 Thread Prathamesh Kulkarni via Gcc-patches
Hi, For the following test-case: int16x8_t foo(int16_t x, int16_t y) { return (int16x8_t) { x, y, x, y, x, y, x, y }; } Code gen at -O3: foo: dupv0.8h, w0 ins v0.h[1], w1 ins v0.h[3], w1 ins v0.h[5], w1 ins v0.h[7], w1 ret

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-11-28 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 21 Nov 2022 at 14:37, Prathamesh Kulkarni wrote: > > On Fri, 4 Nov 2022 at 14:00, Prathamesh Kulkarni > wrote: > > > > On Mon, 31 Oct 2022 at 15:27, Richard Sandiford > > wrote: > > > > > > Prathamesh Kulkarni writes: > >

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-11-21 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 4 Nov 2022 at 14:00, Prathamesh Kulkarni wrote: > > On Mon, 31 Oct 2022 at 15:27, Richard Sandiford > wrote: > > > > Prathamesh Kulkarni writes: > > > On Wed, 26 Oct 2022 at 21:07, Richard Sandiford > > > wrote: > > >> > > &g

Re: [PATCH v2] match.pd: rewrite select to branchless expression

2022-11-10 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 11 Nov 2022 at 07:58, Michael Collison wrote: > > This patches transforms ((x & 0x1) == 0) ? y : z y -into > (-(typeof(y))(x & 0x1) & z) y, where op is a '^' or a '|'. It also > transforms (cond (and (x , 0x1) != 0), (z op y), y ) into (-(and (x , > 0x1)) & z ) op y. > > Matching this

Re: [PATCH v2] tree-object-size: Support strndup and strdup

2022-11-04 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 4 Nov 2022 at 18:18, Siddhesh Poyarekar wrote: > > Use string length of input to strdup to determine the usable size of the > resulting object. Avoid doing the same for strndup since there's a > chance that the input may be too large, resulting in an unnecessary > overhead or worse, the

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-11-04 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 31 Oct 2022 at 15:27, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Wed, 26 Oct 2022 at 21:07, Richard Sandiford > > wrote: > >> > >> Sorry for the slow response. I wanted to find some time to think > >> about this a bi

Re: [PATCH] Optimize VEC_PERM_EXPR with same permutation index and operation [PR98167]

2022-11-04 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 4 Nov 2022 at 05:36, Hongyu Wang via Gcc-patches wrote: > > Hi, > > This is a follow-up patch for PR98167 > > The sequence > c1 = VEC_PERM_EXPR (a, a, mask) > c2 = VEC_PERM_EXPR (b, b, mask) > c3 = c1 op c2 > can be optimized to > c = a op b > c3 = VEC_PERM_EXPR

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-10-28 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 26 Oct 2022 at 21:07, Richard Sandiford wrote: > > Sorry for the slow response. I wanted to find some time to think > about this a bit more. > > Prathamesh Kulkarni writes: > > On Fri, 30 Sept 2022 at 21:38, Richard Sandiford > > wrote: > >> &g

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-10-24 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 17 Oct 2022 at 16:02, Prathamesh Kulkarni wrote: > > On Mon, 10 Oct 2022 at 16:18, Prathamesh Kulkarni > wrote: > > > > On Fri, 30 Sept 2022 at 21:38, Richard Sandiford > > wrote: > > > > > > Richard Sandiford via Gcc-patches writes: > &

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-10-17 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 10 Oct 2022 at 16:18, Prathamesh Kulkarni wrote: > > On Fri, 30 Sept 2022 at 21:38, Richard Sandiford > wrote: > > > > Richard Sandiford via Gcc-patches writes: > > > Prathamesh Kulkarni writes: > > >> Sorry to ask a silly question but in whi

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-10-10 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 30 Sept 2022 at 21:38, Richard Sandiford wrote: > > Richard Sandiford via Gcc-patches writes: > > Prathamesh Kulkarni writes: > >> Sorry to ask a silly question but in which case shall we select 2nd vector > >> ? > >> For num_poly_int_coeffs ==

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-30 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 27 Sept 2022 at 01:59, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Fri, 23 Sept 2022 at 21:33, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 20 Sept 2022 at 18:09, Richard San

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-26 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 23 Sept 2022 at 21:33, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 20 Sept 2022 at 18:09, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Mon, 12 Sept 2022 at 19:57, Richard San

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-23 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 20 Sept 2022 at 18:09, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Mon, 12 Sept 2022 at 19:57, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> >> The VLA encoding encodes the

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-15 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 12 Sept 2022 at 19:57, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Mon, 5 Sept 2022 at 15:51, Richard Sandiford > > wrote: > >> > >> Sorry for the slow reply. I wrote a response a couple of weeks ago > >>

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-09 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 5 Sept 2022 at 15:51, Richard Sandiford wrote: > > Sorry for the slow reply. I wrote a response a couple of weeks ago > but I think it get lost in a machine outage. > > Prathamesh Kulkarni writes: > > Hi, > > The attached prototype patch extends fold_vec

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-09-05 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 5 Sept 2022 at 14:39, Richard Biener wrote: > > On Mon, Sep 5, 2022 at 10:54 AM Prathamesh Kulkarni > wrote: > > > > On Mon, 29 Aug 2022 at 11:53, Prathamesh Kulkarni > > wrote: > > > > > > On Thu, 18 Aug 2022 at 18:20, Prathamesh Kulkarni

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-09-05 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 29 Aug 2022 at 11:53, Prathamesh Kulkarni wrote: > > On Thu, 18 Aug 2022 at 18:20, Prathamesh Kulkarni > wrote: > > > > On Thu, 18 Aug 2022 at 18:14, Prathamesh Kulkarni > > wrote: > > > > > > On Wed, 17 Aug 2022 at 17:01, Richard Biener

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-09-05 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 29 Aug 2022 at 11:38, Prathamesh Kulkarni wrote: > > On Wed, 17 Aug 2022 at 18:09, Prathamesh Kulkarni > wrote: > > > > Hi, > > The attached prototype patch extends fold_vec_perm to fold VEC_PERM_EXPR > > in VLA manner, and currently handles the follow

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-08-29 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 18 Aug 2022 at 18:20, Prathamesh Kulkarni wrote: > > On Thu, 18 Aug 2022 at 18:14, Prathamesh Kulkarni > wrote: > > > > On Wed, 17 Aug 2022 at 17:01, Richard Biener > > wrote: > > > > > > On Tue, Aug 16, 2022 at 6:30 PM Richard Sandi

Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-08-29 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 17 Aug 2022 at 18:09, Prathamesh Kulkarni wrote: > > Hi, > The attached prototype patch extends fold_vec_perm to fold VEC_PERM_EXPR > in VLA manner, and currently handles the following cases: > (a) fixed len arg0, arg1 and fixed len sel. > (b) fixed len arg0, arg1 and

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-08-18 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 18 Aug 2022 at 18:14, Prathamesh Kulkarni wrote: > > On Wed, 17 Aug 2022 at 17:01, Richard Biener > wrote: > > > > On Tue, Aug 16, 2022 at 6:30 PM Richard Sandiford > > wrote: > > > > > > Prathamesh Kulkarni writes: > > > > On

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-08-18 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 17 Aug 2022 at 17:01, Richard Biener wrote: > > On Tue, Aug 16, 2022 at 6:30 PM Richard Sandiford > wrote: > > > > Prathamesh Kulkarni writes: > > > On Tue, 9 Aug 2022 at 18:42, Richard Biener > > > wrote: > > >> > > >> On

Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner

2022-08-17 Thread Prathamesh Kulkarni via Gcc-patches
Hi, The attached prototype patch extends fold_vec_perm to fold VEC_PERM_EXPR in VLA manner, and currently handles the following cases: (a) fixed len arg0, arg1 and fixed len sel. (b) fixed len arg0, arg1 and vla sel (c) vla arg0, arg1 and vla sel with arg0, arg1 being VECTOR_CST. It seems to work

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-08-11 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 9 Aug 2022 at 18:42, Richard Biener wrote: > > On Tue, Aug 9, 2022 at 12:10 PM Prathamesh Kulkarni > wrote: > > > > On Mon, 8 Aug 2022 at 14:27, Richard Biener > > wrote: > > > > > > On Mon, Aug 1, 2022 at 5:17 AM Prathamesh Kulkarni >

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-08-09 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 8 Aug 2022 at 14:27, Richard Biener wrote: > > On Mon, Aug 1, 2022 at 5:17 AM Prathamesh Kulkarni > wrote: > > > > On Thu, 21 Jul 2022 at 12:21, Richard Biener > > wrote: > > > > > > On Wed, Jul 20, 2022 at 5:36 PM Prathamesh Kulkarni >

Re: [PATCH 3/4] match.pd: Teach forwprop to handle VLA VEC_PERM_EXPRs with VLS CONSTRUCTORs as arguments

2022-08-05 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 5 Aug 2022 at 18:26, Andre Vieira (lists) wrote: > > Hi, > > This patch is part of the WIP patch that follows in this series. It's > goal is to teach forwprop to handle VLA VEC_PERM_EXPRs with VLS > CONSTRUCTORs as arguments as preparation for the 'VLA constructor' hook > approach.

Missed lowering to ld1rq from svld1rq for memory operand

2022-08-05 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, Following from off-list discussion, in the attached patch, I wrote pattern similar to vec_duplicate_reg, which seems to work for the svld1rq tests. Does it look OK ? Sorry, I didn't fully understand your suggestion on integrating with vec_duplicate_reg pattern. For vec_duplicate_reg,

Re: [PATCH] match.pd: Add bitwise and pattern [PR106243]

2022-08-03 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 4 Aug 2022 at 00:41, Sam Feifer via Gcc-patches wrote: > > This patch adds a new optimization to match.pd. The pattern, -x & 1, > now gets simplified to x & 1, reducing the number of instructions > produced. Hi Sam, No comments on patch, but wondering if we can similarly add another

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-31 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 21 Jul 2022 at 12:21, Richard Biener wrote: > > On Wed, Jul 20, 2022 at 5:36 PM Prathamesh Kulkarni > wrote: > > > > On Mon, 18 Jul 2022 at 11:57, Richard Biener > > wrote: > > > > > > On Fri, Jul 15, 2022 at 3:49 PM Prathamesh Kulkarni >

Re: [PATCH] Adding three new function attributes for static analysis of file descriptors

2022-07-20 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 20 Jul 2022 at 23:31, Immad Mir via Gcc-patches wrote: > > This patch adds three new function attributes to GCC that > are used for static analysis of usage of file descriptors: > > 1) __attribute__ ((fd_arg(N))): The attributes may be applied to a function > that > takes on open file

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-20 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 18 Jul 2022 at 11:57, Richard Biener wrote: > > On Fri, Jul 15, 2022 at 3:49 PM Prathamesh Kulkarni > wrote: > > > > On Thu, 14 Jul 2022 at 17:22, Richard Sandiford > > wrote: > > > > > > Richard Biener writes: > > > > On Thu, J

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-15 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 14 Jul 2022 at 17:22, Richard Sandiford wrote: > > Richard Biener writes: > > On Thu, Jul 14, 2022 at 9:55 AM Prathamesh Kulkarni > > wrote: > >> > >> On Wed, 13 Jul 2022 at 12:22, Richard Biener > >> wrote: > >> > > >

[aarch64] Use op_mode instead of vmode for op0, op1 in aarch64_vectorize_vec_perm_const

2022-07-14 Thread Prathamesh Kulkarni via Gcc-patches
Hi, For following test case: svint32_t foo() { int32x4_t v = (int32x4_t) { 1, 2, 3, 4 }; svint32_t v2 = svld1rq_s32 (svptrue_b8(), [0]); return v2; } After applying workaround in forwprop to not simplify VEC_PERM_EXPR in simplify_permutation to avoid type error in middle end (or using

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-14 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 13 Jul 2022 at 12:22, Richard Biener wrote: > > On Tue, Jul 12, 2022 at 9:12 PM Prathamesh Kulkarni via Gcc-patches > wrote: > > > > Hi Richard, > > For the following test: > > > > svint32_t f2(int a, int b, int c, int d) > > { > > i

ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-12 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, For the following test: svint32_t f2(int a, int b, int c, int d) { int32x4_t v = (int32x4_t) {a, b, c, d}; return svld1rq_s32 (svptrue_b8 (), [0]); } The compiler emits following ICE with -O3 -mcpu=generic+sve: foo.c: In function ‘f2’: foo.c:4:11: error: non-trivial conversion in

[statistics.cc] ICE in get_function_name with fortran test-case

2022-07-07 Thread Prathamesh Kulkarni via Gcc-patches
Hi, My recent commit to emit asm name with -fdump-statistics-asmname caused following ICE for attached fortran test case. during IPA pass: icf power.fppized.f90:6:26: 6 | END SUBROUTINE power_print | ^ internal compiler error: Segmentation fault 0xfddc13

Re: Floating-point allocation sizes? (was Re: [PATCH] analyzer: Fix handling of non-ints inside allocation size checker [PR106181])

2022-07-05 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 6 Jul 2022 at 03:08, David Malcolm via Gcc-patches wrote: > > On Tue, 2022-07-05 at 21:49 +0200, Tim Lange wrote: > > This patch fixes the ICE reported in PR106181 by Arseny Solokha. With > > this patch, the allocation size checker tries to handle floating-point > > operands of allocation

Re: [statistics.cc] Emit asm name of function with -fdump-statistics-asmname

2022-06-26 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 20 Jun 2022 at 12:52, Richard Biener wrote: > > On Thu, Jun 16, 2022 at 5:05 PM Prathamesh Kulkarni via Gcc-patches > wrote: > > > > Hi, > > I just noticed -fdump-statistics supports asmname sub-option, which > > according to the doc states: > &g

[statistics.cc] Emit asm name of function with -fdump-statistics-asmname

2022-06-16 Thread Prathamesh Kulkarni via Gcc-patches
Hi, I just noticed -fdump-statistics supports asmname sub-option, which according to the doc states: "If DECL_ASSEMBLER_NAME has been set for a given decl, use that in the dump instead of DECL_NAME. Its primary use is ease of use working backward from mangled names in the assembly file." When

Re: [1/2] PR96463 - aarch64 specific changes

2022-06-07 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 6 Jun 2022 at 16:29, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > >> > { > >> >/* The pattern matching functions above are written to look for a > >> > small > >> > number to begin the sequence (0, 1, N/2).

Re: [1/2] PR96463 - aarch64 specific changes

2022-06-05 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 1 Jun 2022 at 14:12, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Thu, 12 May 2022 at 16:15, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Wed, 11 May 2022 at 12:44, Richard Sandiford &g

Re: [2/2] PR96463 -- changes to type checking vec_perm_expr in middle end

2022-05-31 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 23 May 2022 at 22:57, Prathamesh Kulkarni wrote: > > On Mon, 9 May 2022 at 21:21, Prathamesh Kulkarni > wrote: > > > > On Mon, 9 May 2022 at 19:22, Richard Sandiford > > wrote: > > > > > > Prathamesh Kulkarni writes: > > > > On T

Re: [1/2] PR96463 - aarch64 specific changes

2022-05-31 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 12 May 2022 at 16:15, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Wed, 11 May 2022 at 12:44, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Fri, 6 May 2022 at 16:00, Richard Sandiford &g

Re: vec_perm_const hook -- Fix build failure in ARM backend

2022-05-30 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 30 May 2022 at 13:04, Christophe Lyon wrote: > > Hi Prathamesh, > > > On 5/27/22 09:11, Prathamesh Kulkarni via Gcc-patches wrote: > > Hi, > > I forgot to adjust prototype for arm_vectorize_vec_perm_const, which, > > resulted in following > >

vec_perm_const hook -- Fix build failure in ARM backend

2022-05-27 Thread Prathamesh Kulkarni via Gcc-patches
Hi, I forgot to adjust prototype for arm_vectorize_vec_perm_const, which, resulted in following build error: # 00:05:33 make[3]: [Makefile:1787: armv8l-unknown-linux-gnueabihf/bits/largefile-config.h] Error 1 (ignored) # 00:10:53

Re: [0/9] [middle-end] Add param to vec_perm_const hook to specify mode of input operand

2022-05-25 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 26 May 2022 at 00:37, Richard Biener wrote: > > > > > Am 25.05.2022 um 21:03 schrieb Prathamesh Kulkarni > > : > > > > On Wed, 25 May 2022 at 18:27, Richard Biener > > wrote: > >> > >>> On Tue, May 24, 2022

Re: [0/9] [middle-end] Add param to vec_perm_const hook to specify mode of input operand

2022-05-25 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 25 May 2022 at 18:27, Richard Biener wrote: > > On Tue, May 24, 2022 at 9:22 PM Prathamesh Kulkarni via Gcc-patches > wrote: > > > > On Tue, 24 May 2022 at 14:50, Richard Sandiford > > wrote: > > > > > > Prathamesh Kulkarni writes: > >

Re: [0/9] [middle-end] Add param to vec_perm_const hook to specify mode of input operand

2022-05-24 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 24 May 2022 at 14:50, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi > > index c5006afc00d..0a3c733ada9 100644 > > --- a/gcc/doc/tm.texi > > +++ b/gcc/doc/tm.texi > > @@ -6088,14 +6088,18 @@

Re: [PATCH] c++: fix ICE on invalid attributes [PR96637]

2022-05-24 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 29 Apr 2022 at 19:44, Marek Polacek via Gcc-patches wrote: > > This patch fixes crashes with invalid attributes. Arguably it could > make sense to assert seen_error() too. > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk = GCC 13? > > PR c++/96637 > >

Re: [0/9] [middle-end] Add param to vec_perm_const hook to specify mode of input operand

2022-05-24 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 23 May 2022 at 18:14, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Wed, 18 May 2022 at 17:27, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > Hi, > >> > The attached patch adds anot

Re: [PATCH] tree-optimization/100221 - improve DSE a bit

2022-05-24 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 24 May 2022 at 11:50, Richard Biener via Gcc-patches wrote: > > When facing multiple PHI defs and one feeding the other we can > postpone processing uses of one and thus can proceed. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. > > 2022-05-20 Richard Biener > >

Re: [2/2] PR96463 -- changes to type checking vec_perm_expr in middle end

2022-05-23 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 9 May 2022 at 21:21, Prathamesh Kulkarni wrote: > > On Mon, 9 May 2022 at 19:22, Richard Sandiford > wrote: > > > > Prathamesh Kulkarni writes: > > > On Tue, 3 May 2022 at 18:25, Richard Sandiford > > > wrote: > > >> > > >>

Adjust affected targets for vec_perm_const hook

2022-05-23 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, The attached patch addresses formatting nits for affected targets. Tested with make all-gcc stage1 (except for gcn). Sorry if this sounds like a naive question, but what target triplet should I use to build gcn port ? Thanks, Prathamesh diff --git a/gcc/config/aarch64/aarch64.cc

Re: [0/9] [middle-end] Add param to vec_perm_const hook to specify mode of input operand

2022-05-23 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 18 May 2022 at 17:27, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi, > > The attached patch adds another parameter machine_mode op_mode to > > vec_perm_const > > hook to specify mode of input operands. The motivation for doing this >

[8/9] s390 changes to adjust vec_perm_const hook

2022-05-18 Thread Prathamesh Kulkarni via Gcc-patches
Hi, The attached patch adjusts vec_perm_const hook to accommodate the new parameter. For rationale, please see: https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595128.html Unfortunately, I am not sure how to cross test this patch. make all-gcc stage-1 seems to build fine. Is it OK to commit

[7/9] ia64 changes to adjust vec_perm_const hook

2022-05-18 Thread Prathamesh Kulkarni via Gcc-patches
Hi, The attached patch adjusts vec_perm_const hook to accommodate the new parameter. For rationale, please see: https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595128.html Unfortunately, I am not sure how to cross test this patch. make all-gcc stage-1 seems to build fine. Is it OK to commit

[6/9] sparc changes to adjust vec_perm_const hook

2022-05-18 Thread Prathamesh Kulkarni via Gcc-patches
Hi, The attached patch adjusts vec_perm_const hook to accommodate the new parameter. For rationale, please see: https://gcc.gnu.org/pipermail/gcc-patches/2022-May/595128.html Unfortunately, I am not sure how to cross test this patch. make all-gcc stage-1 seems to build fine. Is it OK to commit

<    1   2   3   4   5   6   7   8   9   10   >