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; > > } > > > >

[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-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: [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: 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] 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-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 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: [aarch64] Use force_reg instead of copy_to_mode_reg

2023-04-21 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 21 Apr 2023 at 21:00, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > 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+te

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

[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: [match.pd] [SVE] Add pattern to transform svrev(svrev(v)) --> v

2023-04-24 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 24 Apr 2023 at 15:02, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > gcc/ChangeLog: > > * tree-ssa-forwprop.cc (is_combined_permutation_identity): Try to > > simplify two successive VEC_PERM_EXPRs with single operand and same > >

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

2023-04-22 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 21 Apr 2023 at 20:45, Prathamesh Kulkarni wrote: > > 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 >

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

2023-05-01 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 25 Apr 2023 at 16:29, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > 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-v

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

2023-05-02 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 2 May 2023 at 14:56, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 25 Apr 2023 at 16:29, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > Hi Richard, > >> > While digging thru aa

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

2023-05-02 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 2 May 2023 at 17:32, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 2 May 2023 at 14:56, Richard Sandiford > > wrote: > >> > [aarch64] Improve code-gen for vector initialization with single > >> > con

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

2023-04-23 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 21 Apr 2023 at 21:57, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Wed, 19 Apr 2023 at 16:17, Richard Biener > > wrote: > >> > >> On Wed, Apr 19, 2023 at 11:21 AM Prathamesh Kulkarni > >> wrote: > >> >

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: [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-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) > >

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

[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

[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: [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-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: [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-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: [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: > >> > > >

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: 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-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 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: [committed] libstdc++: Fix P2510R3 "Formatting pointers" [PR110149]

2023-06-12 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 9 Jun 2023 at 17:41, Jonathan Wakely via Gcc-patches wrote: > > Tested powerpc64le-linux. Pushed to trunk. Hi Jonathan, This patch causes following regression on armv8l-unknown-linux-gnueabihf: FAIL: std/format/functions/format.cc execution test

Re: [Patch] libgomp: Use libnuma for OpenMP's partition=nearest allocation trait

2023-07-13 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 12 Jul 2023 at 17:35, Tobias Burnus wrote: > > Now committed as r14-2462-g450b05ce54d3f0. Hi Tobias, The newly added tests in above commit -- alloc-11.c and alloc-12.c seem to fail during execution on armv8l-unknown-linux-gnueabihf: Running libgomp:libgomp.c++/c++.exp ... FAIL:

Re: [PATCH] aarch64: remove useless pairs of rev instructions

2023-07-18 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 18 Jul 2023 at 15:20, Serval Martinot-Lagarde via Gcc-patches wrote: > > SVE generates superflous rev instructions that can be replaced > by single mov instruction or a pair of (rev, mov) instructions Hi Serval, I had added a similar transform to remove pair of rev instructions in:

Re: PING^1 [PATCH v7] tree-ssa-sink: Improve code sinking pass

2023-07-18 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 18 Jul 2023 at 13:26, Ajit Agarwal via Gcc-patches wrote: > > > Ping! > > please review. > > Thanks & Regards > Ajit > > > This patch improves code sinking pass to sink statements before call to reduce > register pressure. > Review comments are incorporated. > > For example : > > void

Re: Pushed: [PATCH v2] vect: Fix vectorized BIT_FIELD_REF for signed bit-fields [PR110557]

2023-07-11 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 10 Jul 2023 at 16:43, Xi Ruoyao via Gcc-patches wrote: > > On Mon, 2023-07-10 at 10:33 +, Richard Biener wrote: > > On Fri, 7 Jul 2023, Xi Ruoyao wrote: > > > > > If a bit-field is signed and it's wider than the output type, we > > > must > > > ensure the extracted result

[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.

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

2023-05-25 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 25 May 2023 at 15:26, Prathamesh Kulkarni wrote: > > On Thu, 25 May 2023 at 13:04, Richard Sandiford > wrote: > > > > LGTM, just a couple of comment tweaks: > > > > Prathamesh Kulkarni writes: > > > diff --git a/gcc/config/aarch64/aarch64.cc b

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

2023-05-24 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 22 May 2023 at 14:18, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > Thanks for the suggestions. Does the attached patch look OK ? > > Boostrap+test in progress on aarch64-linux-gnu. > > Like I say, please wait for the tests to

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

2023-05-25 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 25 May 2023 at 01:28, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Wed, 24 May 2023 at 15:40, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Mon, 22 May 2023 at 14:18, Richard Sandiford &g

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

2023-05-25 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 25 May 2023 at 13:04, Richard Sandiford wrote: > > LGTM, just a couple of comment tweaks: > > Prathamesh Kulkarni writes: > > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > > index d6fc94015fa..db7ca4c28c3 100644 > > --- a

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

2023-05-24 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 24 May 2023 at 15:40, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Mon, 22 May 2023 at 14:18, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > Hi Richard, > >> > Thanks for the su

Re: [COMMITTEDv3] tree-optimization: [PR100864] `(a&!b) | b` is not opimized to `a | b` for comparisons

2023-08-02 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 31 Jul 2023 at 22:39, Andrew Pinski via Gcc-patches wrote: > > This is a new version of the patch. > Instead of doing the matching of inversion comparison directly inside > match, creating a new function (bitwise_inverted_equal_p) to do it. > It is very similar to bitwise_equal_p that was

Re: [PATCH v2] combine: Narrow comparison of memory and constant

2023-07-31 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 1 Aug 2023 at 03:13, Prathamesh Kulkarni wrote: > > On Mon, 19 Jun 2023 at 19:59, Stefan Schulze Frielinghaus via > Gcc-patches wrote: > > > > Comparisons between memory and constants might be done in a smaller mode > > resulting in smaller constants

Re: [PATCH v2] combine: Narrow comparison of memory and constant

2023-07-31 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 19 Jun 2023 at 19:59, Stefan Schulze Frielinghaus via Gcc-patches wrote: > > Comparisons between memory and constants might be done in a smaller mode > resulting in smaller constants which might finally end up as immediates > instead of in the literal pool. > > For example, on s390x a

Re: [C PATCH]: Add Walloc-type to warn about insufficient size in allocations

2023-07-31 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 21 Jul 2023 at 16:52, Martin Uecker via Gcc-patches wrote: > > > > This patch adds a warning for allocations with insufficient size > based on the "alloc_size" attribute and the type of the pointer > the result is assigned to. While it is theoretically legal to > assign to the wrong

Re: [PATCH v2] combine: Narrow comparison of memory and constant

2023-08-01 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 1 Aug 2023 at 05:20, Jeff Law wrote: > > > > On 7/31/23 15:43, Prathamesh Kulkarni via Gcc-patches wrote: > > On Mon, 19 Jun 2023 at 19:59, Stefan Schulze Frielinghaus via > > Gcc-patches wrote: > >> > >> Comparisons between memory and

Re: [COMMITTEDv3] tree-optimization: [PR100864] `(a&!b) | b` is not opimized to `a | b` for comparisons

2023-08-03 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 3 Aug 2023 at 02:54, Andrew Pinski wrote: > > On Wed, Aug 2, 2023 at 10:14 AM Andrew Pinski wrote: > > > > On Wed, Aug 2, 2023 at 10:13 AM Prathamesh Kulkarni via Gcc-patches > > wrote: > > > > > > On Mon, 31 Jul 2023 at 22:39,

Re: [PATCH][RFC] tree-optimization/92335 - Improve sinking heuristics for vectorization

2023-08-03 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 2 Aug 2023 at 14:17, Richard Biener via Gcc-patches wrote: > > On Mon, 31 Jul 2023, Jeff Law wrote: > > > > > > > On 7/28/23 01:05, Richard Biener via Gcc-patches wrote: > > > The following delays sinking of loads within the same innermost > > > loop when it was unconditional before.

[gcc-13] Backport PR10280 fix

2023-07-26 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, Sorry for the delay in backport to gcc-13. The attached patch (cherry picked from master) is bootstrapped+tested on aarch64-linux-gnu with SVE enabled on gcc-13 branch. OK to commit to gcc-13 branch ? Thanks, Prathamesh [aarch64/match.pd] Fix ICE observed in PR110280. gcc/ChangeLog:

Re: [gcc-13] Backport PR10280 fix

2023-07-26 Thread Prathamesh Kulkarni via Gcc-patches
Sorry, I meant PR110280 in subject line (not PR10280). On Wed, 26 Jul 2023 at 23:03, Prathamesh Kulkarni wrote: > > Hi Richard, > Sorry for the delay in backport to gcc-13. > The attached patch (cherry picked from master) is bootstrapped+tested > on aarch64-linux-gnu with SVE en

Re: [WIP RFC] analyzer: Add optional trim of the analyzer diagnostics going too deep [PR110543]

2023-07-22 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 21 Jul 2023 at 21:05, Benjamin Priour via Gcc-patches wrote: > > Hi, > > Upon David's request I've joined the in progress patch to the below email. > I hope it makes more sense now. > > Best, > Benjamin. > > -- Forwarded message - > From: Benjamin Priour > Date: Tue, Jul

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 v

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, > >>> > >>> Tha

Re: [PATCH] poly_int: Handle more can_div_trunc_p cases

2023-08-04 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 3 Aug 2023 at 18:15, Richard Sandiford wrote: > > can_div_trunc_p (a, b, , ) tries to compute a Q and r that > satisfy the usual conditions for truncating division: > > (1) a = b * Q + r > (2) |b * Q| <= |a| > (3) |r| < |b| > > We can compute Q using the constant component

Re: [PATCH] Add -Wdisabled-optimization warning for not optimizing sibling calls

2023-08-05 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 4 Aug 2023 at 23:28, Bradley Lucier via Gcc-patches wrote: > > The patch at the end adds a warning when a tail/sibling call cannot be > optimized for various reasons. > > I built and tested GCC with and without the patch with configuration > > Configured with: ../../gcc-mainline/configure

Re: [PATCH] Add -Wdisabled-optimization warning for not optimizing sibling calls

2023-08-05 Thread Prathamesh Kulkarni via Gcc-patches
On Sun, 6 Aug 2023 at 03:07, Bradley Lucier wrote: > > On 8/5/23 4:58 PM, Prathamesh Kulkarni wrote: > > I don't have comments on the patch, but a new warning will also > > require a corresponding entry in doc/invoke.texi. > > Thank you for your comment. >

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-

Re: [PATCH][RFC] tree-optimization/92335 - Improve sinking heuristics for vectorization

2023-08-06 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 3 Aug 2023 at 17:48, Richard Biener wrote: > > On Thu, 3 Aug 2023, Richard Biener wrote: > > > On Thu, 3 Aug 2023, Richard Biener wrote: > > > > > On Thu, 3 Aug 2023, Prathamesh Kulkarni wrote: > > > > > > > On Wed, 2 Aug 2023 at 1

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 detail

Re: [gcc-13] Backport PR10280 fix

2023-07-31 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 27 Jul 2023 at 12:04, Richard Biener wrote: > > On Wed, 26 Jul 2023, Prathamesh Kulkarni wrote: > > > Sorry, I meant PR110280 in subject line (not PR10280). > > OK after 13.2 is released and the branch is open again. Thanks, committed the patch to releases/gc

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 i

Re: [SVE][match.pd] Fix ICE observed in PR110280

2023-06-22 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 20 Jun 2023 at 16:47, Richard Biener wrote: > > On Tue, Jun 20, 2023 at 11:56 AM Prathamesh Kulkarni via Gcc-patches > wrote: > > > > Hi Richard, > > For the following reduced test-case taken from PR: > > > > #include "arm_sve.h" > >

Re: [SVE][match.pd] Fix ICE observed in PR110280

2023-06-23 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 22 Jun 2023 at 18:06, Richard Biener wrote: > > On Thu, Jun 22, 2023 at 11:08 AM Prathamesh Kulkarni > wrote: > > > > On Tue, 20 Jun 2023 at 16:47, Richard Biener > > wrote: > > > > > > On Tue, Jun 20, 2023 at 11:56 AM Pra

Re: [SVE][match.pd] Fix ICE observed in PR110280

2023-06-23 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 23 Jun 2023 at 14:58, Richard Biener wrote: > > On Fri, Jun 23, 2023 at 11:09 AM Prathamesh Kulkarni > wrote: > > > > On Thu, 22 Jun 2023 at 18:06, Richard Biener > > wrote: > > > > > > On Thu, Jun 22, 2023 at 11:08 AM Prathamesh Kulkarni

Re: [PATCH] arm: Fix MVE intrinsics support with LTO (PR target/110268)

2023-06-26 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 26 Jun 2023 at 20:33, Christophe Lyon via Gcc-patches wrote: > > After the recent MVE intrinsics re-implementation, LTO stopped working > because the intrinsics would no longer be defined. > > The main part of the patch is simple and similar to what we do for > AArch64: > - call

[SVE][match.pd] Fix ICE observed in PR110280

2023-06-20 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, For the following reduced test-case taken from PR: #include "arm_sve.h" svuint32_t l() { alignas(16) const unsigned int lanes[4] = {0, 0, 0, 0}; return svld1rq_u32(svptrue_b8(), lanes); } compiling with -O3 -mcpu=generic+sve results in following ICE: during GIMPLE pass: fre

Re: [SVE] Fold svdupq to VEC_PERM_EXPR if elements are not constant

2023-06-27 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 28 Jun 2023 at 00:05, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > Sorry I forgot to commit this patch, which you had approved in: > > https://gcc.gnu.org/pipermail/gcc-patches/2023-April/615308.html > > > > Jus

[SVE] Fold svdupq to VEC_PERM_EXPR if elements are not constant

2023-06-27 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, Sorry I forgot to commit this patch, which you had approved in: https://gcc.gnu.org/pipermail/gcc-patches/2023-April/615308.html Just for context for the following test: svint32_t f_s32(int32x4_t x) { return svdupq_s32 (x[0], x[1], x[2], x[3]); } -O3 -mcpu=generic+sve generates

Re: [PATCH v2] [PR96339] Optimise svlast[ab]

2023-06-14 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 13 Jun 2023 at 12:38, Tejas Belagod via Gcc-patches wrote: > > > > From: Richard Sandiford > Date: Monday, June 12, 2023 at 2:15 PM > To: Tejas Belagod > Cc: gcc-patches@gcc.gnu.org , Tejas Belagod > > Subject: Re: [PATCH v2] [PR96339] Optimise svlast[ab] > Tejas Belagod writes: > >

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

2023-06-12 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 31 May 2023 at 00:23, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > The s32 case for single constant patch doesn't regress now after the > > above commit. > > Bootstrapped+tested on aarch64-linux-gnu, and verified that the new

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

2023-05-13 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 12 May 2023 at 00:37, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > diff --git a/gcc/testsuite/gcc.target/aarch64/vec-init-18.c > > b/gcc/testsuite/gcc.target/aarch64/vec-init-18.c > > new file mode 100644 > > index 000..598a51f17c6 &

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

2023-05-15 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 12 May 2023 at 00:45, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > > On Tue, 2 May 2023 at 18:22, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 2 May 2023 at 17:32, Richard Sandiford

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

2023-05-04 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 24 Apr 2023 at 15:00, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > [aarch64] Recursively intialize even and odd sub-parts and merge with zip1. > > > > gcc/ChangeLog: > > * config/aarch64/aarch64.cc (aarch64_expand_vect

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

2023-05-03 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 2 May 2023 at 18:22, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 2 May 2023 at 17:32, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 2 May 2023 at 14:56, Richard Sandiford >

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

2023-05-18 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 18 May 2023 at 13:37, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Tue, 16 May 2023 at 00:29, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > Hi Richard, > >> > After co

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

2023-05-19 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 18 May 2023 at 22:04, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Thu, 18 May 2023 at 13:37, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Tue, 16 May 2023 at 00:29, Richard Sandiford &g

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

2023-05-17 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 16 May 2023 at 00:29, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi Richard, > > After committing the interleave+zip1 patch for vector initialization, > > it seems to regress the s32 case for this patch: > > > > int32x4_t f_s32(int3

Re: [PATCH][RFC] tree-optimization/92335 - Improve sinking heuristics for vectorization

2023-08-14 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 7 Aug 2023 at 13:19, Richard Biener wrote: > > On Mon, Aug 7, 2023 at 2:05 AM Prathamesh Kulkarni via Gcc-patches > wrote: > > > > On Thu, 3 Aug 2023 at 17:48, Richard Biener wrote: > > > > > > On Thu, 3 Aug 2023, Richard Biener wrote: > >

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

Re: [pushed]LRA]: Fix asserts for output stack pointer reloads

2023-08-14 Thread Prathamesh Kulkarni via Gcc-patches
On Mon, 14 Aug 2023 at 06:39, Vladimir Makarov via Gcc-patches wrote: > > The following patch fixes useless asserts in my latest patch > implementing output stack pointer reloads. Hi Vladimir, It seems that this patch caused the following ICE on aarch64-linux-gnu while building cp-demangle.c:

<    5   6   7   8   9   10