Re: [PATCH v2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-24 Thread Richard Biener
On Fri, May 24, 2024 at 8:56 AM Richard Biener wrote: > > On Fri, May 24, 2024 at 8:37 AM Li, Pan2 wrote: > > > > Thanks Jeff and Richard for suggestion and reviewing. > > > > Have another try in phiopt to do the convert from PHI to stmt = cond ? a : > > b. > > It can perform the convert from PH

[V3 PATCH] Don't reduce estimated unrolled size for innermost loop.

2024-05-24 Thread liuhongt
Update in V3: > Since this was about vectorization can you instead add a testcase to > gcc.dg/vect/ and check for > vectorization to happen? Move to vect/pr112325.c. > > I believe the if (unr_insn <= 0) check can go as well. Removed. > as said, you want to do > > curolli = false; > > aft

Re: [PATCH] MATCH: Look through VIEW_CONVERT when folding VEC_PERM_EXPRs.

2024-05-24 Thread Manolis Tsamis
On Fri, May 24, 2024 at 9:31 AM Richard Biener wrote: > > On Wed, 22 May 2024, Manolis Tsamis wrote: > > > The match.pd patterns to merge two vector permutes into one fail when a > > potentially no-op view convert expressions is between the two permutes. > > This change lifts this restriction. > >

Re: [PATCH] MATCH: Look through VIEW_CONVERT when folding VEC_PERM_EXPRs.

2024-05-24 Thread Richard Biener
On Fri, 24 May 2024, Manolis Tsamis wrote: > On Fri, May 24, 2024 at 9:31 AM Richard Biener wrote: > > > > On Wed, 22 May 2024, Manolis Tsamis wrote: > > > > > The match.pd patterns to merge two vector permutes into one fail when a > > > potentially no-op view convert expressions is between the t

RE: [PATCH v2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-24 Thread Li, Pan2
Thanks Richard for help and comments. If my understanding is correct, I should be able to follow below step(s) to support the branch form for unsigned SAT_ADD. 1. Building a helper in one place to match a PHI def as COND_EXPR (or even a better way to do it by providing native support from genma

[PATCH] Fix typo in the testcase.

2024-05-24 Thread liuhongt
Committed as an obvious patch. gcc/testsuite/ChangeLog: PR target/114148 * gcc.target/i386/pr106010-7b.c: Refine testcase. --- gcc/testsuite/gcc.target/i386/pr106010-7b.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Nathaniel Shead
On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: > On 5/13/24 07:56, Nathaniel Shead wrote: > > > > @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, tree > > > > args) > > > > if (tmpl != error_mark_node) > > > > { > > > > /* The new TMPL is

Re: [PATCH] MATCH: Look through VIEW_CONVERT when folding VEC_PERM_EXPRs.

2024-05-24 Thread Manolis Tsamis
On Fri, May 24, 2024 at 10:46 AM Richard Biener wrote: > > On Fri, 24 May 2024, Manolis Tsamis wrote: > > > On Fri, May 24, 2024 at 9:31 AM Richard Biener wrote: > > > > > > On Wed, 22 May 2024, Manolis Tsamis wrote: > > > > > > > The match.pd patterns to merge two vector permutes into one fail w

Re: [PATCH] MATCH: Look through VIEW_CONVERT when folding VEC_PERM_EXPRs.

2024-05-24 Thread Richard Biener
On Fri, 24 May 2024, Manolis Tsamis wrote: > On Fri, May 24, 2024 at 10:46 AM Richard Biener wrote: > > > > On Fri, 24 May 2024, Manolis Tsamis wrote: > > > > > On Fri, May 24, 2024 at 9:31 AM Richard Biener wrote: > > > > > > > > On Wed, 22 May 2024, Manolis Tsamis wrote: > > > > > > > > > The

[RFC/RFA][PATCH 00/12] CRC optimization

2024-05-24 Thread Mariam Arutunian
Hello! This patch set detects bitwise CRC implementation loops (with branches) in the GIMPLE optimizers and replaces them with more optimal CRC implementations in RTL. These patches introduce new internal functions, built-in functions, and expanders for CRC generation, leveraging hardware instructi

[RFC/RFA] [PATCH 01/12] Implement internal functions for efficient CRC computation

2024-05-24 Thread Mariam Arutunian
Add two new internal functions (IFN_CRC, IFN_CRC_REV), to provide faster CRC generation. One performs bit-forward and the other bit-reversed CRC computation. If CRC optabs are supported, they are used for the CRC computation. Otherwise, table-based CRC is generated. The supported data and CRC sizes

[RFC/RFA] [PATCH 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-05-24 Thread Mariam Arutunian
If the target is ZBC or ZBKC, it uses clmul instruction for the CRC calculation. Otherwise, if the target is ZBKB, generates table-based CRC, but for reversing inputs and the output uses bswap and brev8 instructions. Add new tests to check CRC generation for ZBC, ZBKC and ZBKB targets. gcc/

[RFC/RFA] [PATCH 06/12] aarch64: Implement new expander for efficient CRC computation

2024-05-24 Thread Mariam Arutunian
This patch introduces two new expanders for the aarch64 backend, dedicated to generate optimized code for CRC computations. The new expanders are designed to leverage specific hardware capabilities to achieve faster CRC calculations, particularly using the pmul or crc32 instructions when supported

[RFC/RFA] [PATCH 02/12] Add built-ins and tests for bit-forward and bit-reversed CRCs

2024-05-24 Thread Mariam Arutunian
This patch introduces new built-in functions to GCC for computing bit-forward and bit-reversed CRCs. These builtins aim to provide efficient CRC calculation capabilities. When the target architecture supports CRC operations (as indicated by the presence of a CRC optab), the builtins will utilize th

[RFC/RFA] [PATCH 04/12] RISC-V: Add CRC built-ins tests for the target ZBC.

2024-05-24 Thread Mariam Arutunian
gcc/testsuite/gcc.target/riscv/ * crc-builtin-zbc32.c: New file. * crc-builtin-zbc64.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c b/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c new file mode 100644 index 000.

[RFC/RFA] [PATCH 07/12] aarch64: Add CRC built-ins test for the target AES.

2024-05-24 Thread Mariam Arutunian
gcc/testsuite/gcc.target/aarch64/ * crc-builtin-pmul64.c: New test. Signed-off-by: Mariam Arutunian diff --git a/gcc/testsuite/gcc.target/aarch64/crc-builtin-pmul64.c b/gcc/testsuite/gcc.target/aarch64/crc-builtin-pmul64.c new file mode 100644 index 000..d8bb1724a65 --- /dev/null +

[RFC/RFA] [PATCH 09/12] Add symbolic execution support.

2024-05-24 Thread Mariam Arutunian
Gives an opportunity to execute the code on bit level, assigning symbolic values to the variables which don't have initial values. Supports only CRC specific operations. Example: uint8_t crc; uint8_t pol = 1; crc = crc ^ pol; during symbolic execution crc's value will be: crc(8), crc(7), ... crc

[RFC/RFA] [PATCH 05/12] i386: Implement new expander for efficient CRC computation

2024-05-24 Thread Mariam Arutunian
This patch introduces two new expanders for the i386 backend, dedicated to generating optimized code for CRC computations. The new expanders are designed to leverage specific hardware capabilities to achieve faster CRC calculations, particularly using the pclmulqdq or crc32 instructions when suppor

[RFC/RFA] [PATCH 08/12] Add a new pass for naive CRC loops detection

2024-05-24 Thread Mariam Arutunian
This patch adds a new compiler pass aimed at identifying naive CRC implementations, characterized by the presence of a loop calculating a CRC (polynomial long division). Upon detection of a potential CRC, the pass prints an informational message. Performs CRC optimization if optimization level is

[RFC/RFA] [PATCH 11/12] Replace the original CRC loops with a faster CRC calculation.

2024-05-24 Thread Mariam Arutunian
Specifically, use the following alternatives: If the target supports the crc32 instruction, use it directly. If the target supports the carry-less multiplication instruction, use it to calculate the CRC. If the target does not support either of the above, use a table-based CRC calculation. Du

[RFC/RFA] [PATCH 10/12] Verify detected CRC loop with symbolic execution and LFSR matching

2024-05-24 Thread Mariam Arutunian
Symbolically execute potential CRC loops and check whether the loop actually calculates CRC (uses LFSR matching). Calculated CRC and created LFSR are compared on each iteration of the potential CRC loop. gcc/ * Makefile.in (OBJS): Add crc-verification.o. * crc-verification.cc: New file.

Re: [PATCH] MATCH: Look through VIEW_CONVERT when folding VEC_PERM_EXPRs.

2024-05-24 Thread Manolis Tsamis
The match.pd patterns to merge two vector permutes into one fail when a potentially no-op view convert expression is between the two permutes. This change lifts this restriction. gcc/ChangeLog: * match.pd: Allow no-op view_convert between permutes. gcc/testsuite/ChangeLog: * gcc.dg/fold-perm-2.

[PATCH] Hard register asm constraint

2024-05-24 Thread Stefan Schulze Frielinghaus
This implements hard register constraints for inline asm. A hard register constraint is of the form {regname} where regname is any valid register. This basically renders register asm superfluous. For example, the snippet int test (int x, int y) { register int r4 asm ("r4") = x; register int

Re: [PATCH] vect: Support multiple lane-reducing operations for loop reduction [PR114440]

2024-05-24 Thread Feng Xue OS
Hi, The patch was updated with the newest trunk, and also contained some minor changes. I am working on another new feature which is meant to support pattern recognition of lane-reducing operations in affine closure originated from loop reduction variable, like: sum += cst1 * dot_prod_1 + c

Re: [Patch, aarch64, middle-end] v3: Move pair_fusion pass from aarch64 to middle-end

2024-05-24 Thread Ajit Agarwal
Hello Alex: On 22/05/24 3:30 pm, Alex Coplan wrote: > Hi Ajit, > > You need to remove the header dependencies that are no longer required > for aarch64-ldp-fusion.o in t-aarch64 (not forgetting to update the > ChangeLog). A few other minor nits below. > > LGTM with those changes, but you'll nee

[r15-812 Regression] FAIL: gcc.dg/vect/vect-gather-4.c scan-tree-dump-not vect "Loop contains only SLP stmts" on Linux/x86_64

2024-05-24 Thread haochen.jiang
On Linux/x86_64, c71886f2ca2e46ce1449c7064d6f1b447d02fcba is the first bad commit commit c71886f2ca2e46ce1449c7064d6f1b447d02fcba Author: Richard Biener Date: Fri Sep 29 13:13:16 2023 +0200 Avoid splitting store dataref groups during SLP discovery caused FAIL: gcc.dg/vect/vect-gather-4.c

[PATCH v2] MATCH: Look through VIEW_CONVERT when folding VEC_PERM_EXPRs.

2024-05-24 Thread Manolis Tsamis
The match.pd patterns to merge two vector permutes into one fail when a potentially no-op view convert expressions is between the two permutes. This change lifts this restriction. gcc/ChangeLog: * match.pd: Allow no-op view_convert between permutes. gcc/testsuite/ChangeLog: * gc

[RFC/PATCH] Replace {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE with new hook

2024-05-24 Thread Kewen.Lin
Hi Joseph and Richi, on 2024/5/13 21:18, Joseph Myers wrote: > On Mon, 13 May 2024, Kewen.Lin wrote: > >>> In fact replacing all of X_TYPE_SIZE with a single hook might be worthwhile >>> though this removes the "convenient" defaulting, requiring each target to >>> enumerate all standard C ABI typ

Re: [PATCH 12/13] rs6000, remove __builtin_vsx_xvcmpeqsp built-in

2024-05-24 Thread Kewen.Lin
Hi, on 2024/5/24 02:21, Carl Love wrote: > > > On 5/13/24 22:37, Kewen.Lin wrote: >> Hi, >> >> on 2024/4/20 05:18, Carl Love wrote: >>> rs6000, remove __builtin_vsx_xvcmpeqsp built-in >>> >>> The built-in __builtin_vsx_xvcmpeqsp is a duplicate of the overloaded >>> vec_cmpeq built-in. The built

[PATCH][v2] tree-optimization/115144 - improve sinking destination choice

2024-05-24 Thread Richard Biener
When sinking code closer to its uses we already try to minimize the distance we move by inserting at the start of the basic-block. The following makes sure to sink closest to the control dependence check of the region we want to sink to as well as make sure to ignore control dependences that are o

Re: [PATCH v2] MATCH: Look through VIEW_CONVERT when folding VEC_PERM_EXPRs.

2024-05-24 Thread Richard Biener
On Fri, 24 May 2024, Manolis Tsamis wrote: > The match.pd patterns to merge two vector permutes into one fail when a > potentially no-op view convert expressions is between the two permutes. > This change lifts this restriction. OK. > gcc/ChangeLog: > > * match.pd: Allow no-op view_conver

[PATCH] Fix gcc.dg/vect/vect-gather-4.c for cascadelake

2024-05-24 Thread Richard Biener
There's not really a good way to test what the testcase wants to test, the following exchanges one dump scan for another (imperfect) one. Pushed. * gcc.dg/vect/vect-gather-4.c: Scan for not vectorizing using SLP. --- gcc/testsuite/gcc.dg/vect/vect-gather-4.c | 2 +- 1 file change

Re: [PATCH] adjust vectorization expectations for ppc costmodel 76b

2024-05-24 Thread Alexandre Oliva
On May 23, 2024, Alexandre Oliva wrote: > On Apr 29, 2024, "Kewen.Lin" wrote: >> I think you can still push the patch as the testing just exposes >> another issue. > ACK, thanks, I've just confirmed that the problem I reported on > ppc64el-linux-gnu didn't come up when testing on ppc64-vx7r2 wi

[PATCH] tree-ssa-pre.c/1071140(ICE in find_or_generate_expression, at tree-ssa-pre.c:2780): Return NULL_TREE if no equal.

2024-05-24 Thread Jiawei
An ICE bug reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071140. https://godbolt.org/z/WE9aGYvoo Return NULL_TREE when TREE_CODE(op) not equal to SSA_NAME. gcc/ChangeLog: * tree-ssa-pre.cc (find_or_generate_expression): Remove assert. gcc/testsuite/ChangeLog: *

Re: [PATCH V2] RISC-V: Fix missing boolean_expression in zmmul extension

2024-05-24 Thread Kito Cheng
LGTM Liao Shihua 於 2024年5月24日 週五 13:05 寫道: > Update v1->v2 > Add testcase for this patch. > > Missing boolean_expression TARGET_ZMMUL in riscv_rtx_costs() cause > different instructions when > multiplying an integer with a constant. ( > https://github.com/riscv-collab/riscv-gnu-toolchain/iss

Re: [PATCH v2] MATCH: Look through VIEW_CONVERT when folding VEC_PERM_EXPRs.

2024-05-24 Thread Philipp Tomsich
On Fri, 24 May 2024 at 13:02, Richard Biener wrote: > > On Fri, 24 May 2024, Manolis Tsamis wrote: > > > The match.pd patterns to merge two vector permutes into one fail when a > > potentially no-op view convert expressions is between the two permutes. > > This change lifts this restriction. > > O

[PATCH] Add testcase for PR c++/105229: ICE in lookup_template_class_1

2024-05-24 Thread Simon Martin
Hi, The test case in PR c++/105229 has been fixed since 11.4 (via PR c++/106024) - the attached patch simply adds the case to the test suite. Successfully tested on x86_64-pc-linux-gnu. OK for trunk? Thanks! Simon PR c++/105229 gcc/testsuite/ChangeLog: * g++.dg/parse/crash

Re: [RFC/PATCH] Replace {FLOAT, {, LONG_}DOUBLE}_TYPE_SIZE with new hook

2024-05-24 Thread Richard Biener
On Fri, May 24, 2024 at 12:20 PM Kewen.Lin wrote: > > Hi Joseph and Richi, > > on 2024/5/13 21:18, Joseph Myers wrote: > > On Mon, 13 May 2024, Kewen.Lin wrote: > > > >>> In fact replacing all of X_TYPE_SIZE with a single hook might be > >>> worthwhile > >>> though this removes the "convenient" d

Re: [PATCH] tree-ssa-pre.c/1071140(ICE in find_or_generate_expression, at tree-ssa-pre.c:2780): Return NULL_TREE if no equal.

2024-05-24 Thread Richard Biener
On Fri, May 24, 2024 at 1:49 PM Jiawei wrote: > > An ICE bug reported in > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071140. > https://godbolt.org/z/WE9aGYvoo > > Return NULL_TREE when TREE_CODE(op) not equal to SSA_NAME. The assert is on purpose. Can you open a GCC bug for this please?

[PATCH] vect: Fix access size alignment assumption [PR115192]

2024-05-24 Thread Richard Sandiford
create_intersect_range_checks checks whether two access ranges a and b are alias-free using something equivalent to: end_a <= start_b || end_b <= start_a It has two ways of doing this: a "vanilla" way that calculates the exact exclusive end pointers, and another way that uses the last inclusive

Re: [PATCH] vect: Fix access size alignment assumption [PR115192]

2024-05-24 Thread Richard Biener
On Fri, May 24, 2024 at 2:35 PM Richard Sandiford wrote: > > create_intersect_range_checks checks whether two access ranges > a and b are alias-free using something equivalent to: > > end_a <= start_b || end_b <= start_a > > It has two ways of doing this: a "vanilla" way that calculates > the ex

Re: [PATCH] tree-ssa-pre.c/1071140(ICE in find_or_generate_expression, at tree-ssa-pre.c:2780): Return NULL_TREE if no equal.

2024-05-24 Thread Jiawei
On 2024/5/24 20:33, Richard Biener wrote: On Fri, May 24, 2024 at 1:49 PM Jiawei wrote: An ICE bug reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071140. https://godbolt.org/z/WE9aGYvoo Return NULL_TREE when TREE_CODE(op) not equal to SSA_NAME. The assert is on purpose. Can

[PATCH 1/5] Do single-lane SLP discovery for reductions

2024-05-24 Thread Richard Biener
This is the second merge proposed from the SLP vectorizer branch. I have again managed without adding and using --param vect-single-lane-slp but instead this provides always enabled functionality. This makes us use SLP reductions (a group of reductions) for the case where the group size is one. T

[PATCH 2/5] Avoid bogus SLP outer loop vectorization

2024-05-24 Thread Richard Biener
This fixes the check for multiple types which go wrong I think because of bogus pointer IV increments when there are multiple copies of vector stmts in the inner loop. * tree-vect-stmts.cc (vectorizable_load): Avoid outer loop SLP vectorization with multi-copy vector stmts in the i

[PATCH 3/5] Reduce single-lane SLP testresult noise

2024-05-24 Thread Richard Biener
The following avoids dumping 'vectorizing stmts using SLP' for single-lane instances since that causes extra testsuite fallout. * tree-vect-slp.cc (vect_schedule_slp): Gate dumping 'vectorizing stmts using SLP' on > 1 lanes. --- gcc/tree-vect-slp.cc | 3 ++- 1 file changed, 2 inse

[PATCH 4/5] Allow optimized SLP reduction epilog with single-lane reductions

2024-05-24 Thread Richard Biener
This extends optimized reduction epilog handling to cover the trivial single-lane SLP reduction case. * tree-vect-loop.cc (vect_create_epilog_for_reduction): Allow direct opcode and shift reduction also for SLP reductions with a single lane. --- gcc/tree-vect-loop.cc | 4 +

[PATCH 5/5] RISC-V: tree-optimization/65518 - extend fix to SLP

2024-05-24 Thread Richard Biener
This extends the PR65518 workaround to also apply for single-lane SLP. * tree-vect-stmts.cc (get_group_load_store_type): For SLP also check for the PR65518 single-element interleaving case as done in vect_grouped_load_supported. --- gcc/tree-vect-stmts.cc | 17

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Jason Merrill
On 5/24/24 04:06, Nathaniel Shead wrote: On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: On 5/13/24 07:56, Nathaniel Shead wrote: @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, tree args) if (tmpl != error_mark_node) { /* The new TMPL

Re: [PATCH v3] libstdc++: Fix std::ranges::iota not in numeric [PR108760]

2024-05-24 Thread Michael Levine (BLOOMBERG/ 731 LEX)
I've attached the v3 version of the patch as a single, squashed patch containing all of the changes. I manually prepended my sign off to the patch. From: ppa...@redhat.com At: 05/23/24 18:41:14 UTC-4:00To: Michael Levine (BLOOMBERG/ 731 LEX ) Cc: gcc-patches@gcc.gnu.org, libstd...@gcc.gnu.o

Re: [PATCH 1/2] c++/modules: Fix treatment of unnamed types

2024-05-24 Thread Jason Merrill
On 5/23/24 21:27, Nathaniel Shead wrote: On Thu, May 23, 2024 at 03:36:48PM -0400, Jason Merrill wrote: On 5/23/24 09:27, Nathaniel Shead wrote: On Mon, May 20, 2024 at 06:00:09PM -0400, Jason Merrill wrote: On 5/17/24 02:14, Nathaniel Shead wrote: On Tue, May 14, 2024 at 06:21:48PM -0400, Ja

Re: [PATCH v2] c++: mark TARGET_EXPRs for function arguments eliding [PR114707]

2024-05-24 Thread Jason Merrill
On 5/23/24 20:32, Marek Polacek wrote: On Thu, May 23, 2024 at 04:04:13PM -0400, Jason Merrill wrote: On 5/23/24 10:41, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Coming back to our discussion in

Re: [PATCH v2] c++/modules: Improve errors for bad module-directives [PR115200]

2024-05-24 Thread Jason Merrill
On 5/23/24 19:58, Nathaniel Shead wrote: On Thu, May 23, 2024 at 05:11:39PM -0400, Jason Merrill wrote: On 5/23/24 10:54, Nathaniel Shead wrote: Bootstrapped and regtested (so far just modules.exp and dg.exp) on x86_64-pc-linux-gnu, OK for trunk if full regtest succeeds? -- >8 -- This fixes a

Re: [PATCH v3] libstdc++: Fix std::ranges::iota not in numeric [PR108760]

2024-05-24 Thread Jonathan Wakely
On 24/05/24 13:56 -, Michael Levine (BLOOMBERG/ 731 LEX) wrote: I've attached the v3 version of the patch as a single, squashed patch containing all of the changes. I manually prepended my sign off to the patch. Signed-off-by: Michael Levine --- diff --git a/libstdc++-v3/include/bits/r

Re: [PATCH] c++: extend -Wself-move for mem-init-list [PR109396]

2024-05-24 Thread Jason Merrill
On 5/23/24 19:57, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- We already warn for: x = std::move (x); which triggers: warning: moving 'x' of type 'int' to itself [-Wself-move] but bug 109396 reports that this doesn't work for a member-init

Re: [PATCH] Avoid vector -Wfree-nonheap-object warnings

2024-05-24 Thread Jonathan Wakely
On Thu, 23 May 2024 at 18:38, François Dumont wrote: > > > On 23/05/2024 15:31, Jonathan Wakely wrote: > > On 23/05/24 06:55 +0200, François Dumont wrote: > >> As explained in this email: > >> > >> https://gcc.gnu.org/pipermail/libstdc++/2024-April/058552.html > >> > >> I experimented -Wfree-nonhe

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Nathaniel Shead
On Fri, May 24, 2024 at 09:54:31AM -0400, Jason Merrill wrote: > On 5/24/24 04:06, Nathaniel Shead wrote: > > On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: > > > On 5/13/24 07:56, Nathaniel Shead wrote: > > > > > > @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, >

[PATCH] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Robin Dapp
Hi, this patch changes the default from always enabling movmisalign to disabling it. It adds an option to override the default and adds generic-ooo to the uarchs that support misaligned vector access. It also adds a check_effective_target_riscv_v_misalign_ok to the testsuite which enables or dis

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Iain Sandoe
> On 24 May 2024, at 14:54, Jason Merrill wrote: > > On 5/24/24 04:06, Nathaniel Shead wrote: >> On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: >>> On 5/13/24 07:56, Nathaniel Shead wrote: >> @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, tree >> args)

Re: [PATCH] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Palmer Dabbelt
On Fri, 24 May 2024 07:30:20 PDT (-0700), Robin Dapp wrote: Hi, this patch changes the default from always enabling movmisalign to disabling it. It adds an option to override the default and adds generic-ooo to the uarchs that support misaligned vector access. It also adds a check_effective_ta

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Jason Merrill
On 5/24/24 10:40, Iain Sandoe wrote: On 24 May 2024, at 14:54, Jason Merrill wrote: On 5/24/24 04:06, Nathaniel Shead wrote: On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: On 5/13/24 07:56, Nathaniel Shead wrote: @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tm

Re: [PATCH 12/13] rs6000, remove __builtin_vsx_xvcmpeqsp built-in

2024-05-24 Thread Carl Love
Kewen: On 5/24/24 03:43, Kewen.Lin wrote: > Hi, > > on 2024/5/24 02:21, Carl Love wrote: >> >> >> On 5/13/24 22:37, Kewen.Lin wrote: >>> Hi, >>> >>> on 2024/4/20 05:18, Carl Love wrote: rs6000, remove __builtin_vsx_xvcmpeqsp built-in The built-in __builtin_vsx_xvcmpeqsp is a duplic

[PATCH] c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

2024-05-24 Thread Nathaniel Shead
This is just a small improvement to a diagnostic. I thought about also adding an inform to suggest something like "standard library headers should be included in the GMF" or somesuch, but I'm not sure that'll be especially valuable and may be confusing if this particular error is caused some other

Re: [PATCH] c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

2024-05-24 Thread Jason Merrill
On 5/24/24 11:20, Nathaniel Shead wrote: This is just a small improvement to a diagnostic. I thought about also adding an inform to suggest something like "standard library headers should be included in the GMF" or somesuch, but I'm not sure that'll be especially valuable and may be confusing if

Re: [PATCH] c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

2024-05-24 Thread Nathaniel Shead
On Fri, May 24, 2024 at 11:24:38AM -0400, Jason Merrill wrote: > On 5/24/24 11:20, Nathaniel Shead wrote: > > This is just a small improvement to a diagnostic. I thought about also > > adding an inform to suggest something like "standard library headers > > should be included in the GMF" or somesu

[PATCH v2] tree-ssa-pre.c/115214(ICE in find_or_generate_expression, at tree-ssa-pre.c:2780): Return NULL_TREE when deal special cases.

2024-05-24 Thread Jiawei
Return NULL_TREE when match the POLY_INT case. https://gcc.gnu.org/pipermail/gcc-patches/2024-May/652641.html gcc/ChangeLog: * tree-ssa-pre.cc (create_component_ref_by_pieces_1): New * conditions. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/pr115214.c: New tes

Re: [PATCH] c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

2024-05-24 Thread Jason Merrill
On 5/24/24 11:32, Nathaniel Shead wrote: On Fri, May 24, 2024 at 11:24:38AM -0400, Jason Merrill wrote: On 5/24/24 11:20, Nathaniel Shead wrote: This is just a small improvement to a diagnostic. I thought about also adding an inform to suggest something like "standard library headers should be

[C PATCH, v2]: allow aliasing of compatible types derived from enumeral types [PR115157]

2024-05-24 Thread Martin Uecker
This is another version of this patch with two changes: - I added a fix (with test) for PR 115177 which is just the same issue for hardbools which are internally implemented as enums. - I fixed the golang issue. Since the addition of the main variant to the seen decls is unconditional I removed

Re: [PATCH] .gitattributes: disable crlf translation

2024-05-24 Thread Peter0x44
On 2024-05-23 05:01, Richard Biener wrote: On Thu, May 23, 2024 at 5:50 AM Peter Damianov wrote: By default, git has the "autocrlf" """feature""" enabled. This causes the files to have CRLF line endings when checked out on windows, which in the case of configure, causes confusing errors lik

Re: [C PATCH, v2]: allow aliasing of compatible types derived from enumeral types [PR115157]

2024-05-24 Thread Jakub Jelinek
On Fri, May 24, 2024 at 05:39:45PM +0200, Martin Uecker wrote: > PR 115157 > PR 115177 > > gcc/c/ > * c-decl.cc (shadow_tag-warned,parse_xref_tag,start_enum, > finish_enum): Set SET_TYPE_STRUCTURAL_EQUALITY / TYPE_CANONICAL. > * c-obj-common.cc (

[PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Robin Dapp
> We should have something in doc/invoke too, this one is going to be > tricky for users. We'll also have to define how this interacts with > the existing -mstrict-align. Addressed the rest in the attached v2 which also fixes tests. I'm really not sure about -mstrict-align. I would have hoped th

Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Palmer Dabbelt
On Fri, 24 May 2024 09:19:09 PDT (-0700), Robin Dapp wrote: We should have something in doc/invoke too, this one is going to be tricky for users. We'll also have to define how this interacts with the existing -mstrict-align. Addressed the rest in the attached v2 which also fixes tests. I'm rea

[c-family] Small enhancement to implementation of -fdump-ada-spec

2024-05-24 Thread Eric Botcazou
This lets it recognize more preprocessing floating constants. Tested on x86-64/Linux, applied on the mainline. 2024-05-24 Eric Botcazou * c-ada-spec.cc (is_cpp_float): New predicate. (dump_number): Deal with more preprocessing floating constants. (dump_ada_macros) : U

Re: [PATCH, v2] Fortran: improve attribute conflict checking [PR93635]

2024-05-24 Thread Mikael Morin
Le 23/05/2024 à 21:15, Harald Anlauf a écrit : Hi Mikael, On 5/23/24 09:49, Mikael Morin wrote: Le 13/05/2024 à 09:25, Mikael Morin a écrit : Le 10/05/2024 à 21:56, Harald Anlauf a écrit : Am 10.05.24 um 21:48 schrieb Harald Anlauf: Hi Mikael, Am 10.05.24 um 11:45 schrieb Mikael Morin: Le

Re: [PATCH] Add testcase for PR c++/105229: ICE in lookup_template_class_1

2024-05-24 Thread Jason Merrill
On 5/24/24 08:16, Simon Martin wrote: The test case in PR c++/105229 has been fixed since 11.4 (via PR c++/106024) - the attached patch simply adds the case to the test suite. Successfully tested on x86_64-pc-linux-gnu. OK for trunk? OK, thanks. BTW, the patch was corrupted by your mail clien

Re: [PATCH, v2] Fortran: improve attribute conflict checking [PR93635]

2024-05-24 Thread Harald Anlauf
Hi Mikael, On 5/24/24 20:17, Mikael Morin wrote: Le 23/05/2024 à 21:15, Harald Anlauf a écrit : Hi Mikael, On 5/23/24 09:49, Mikael Morin wrote: Le 13/05/2024 à 09:25, Mikael Morin a écrit : Le 10/05/2024 à 21:56, Harald Anlauf a écrit : Am 10.05.24 um 21:48 schrieb Harald Anlauf: Hi Mikae

Re: [PATCH] c++: Fix parsing of abstract-declarator starting with ... followed by [ or ( [PR115012]

2024-05-24 Thread Jason Merrill
On 5/9/24 14:12, Jakub Jelinek wrote: The C++26 P2662R3 Pack indexing paper mentions that both GCC and MSVC don't handle T...[10] parameter declaration when T is a pack. While that will change meaning in C++26, in C++11 .. C++23 this ought to be valid. Sure, but I don't think it does anyone a

[PATCH 0/3] openmp: Add support for iterators in OpenMP mapping clauses (C/C++)

2024-05-24 Thread Kwok Cheung Yeung
This series of patches adds support for OpenMP iterators in the 'map' clause of the 'target' construct (and it's derivatives such as 'target enter data'), and the 'to' and 'from' constructs of the 'target update' construct, currently for C and C++ only. The approach in this patch differs from

[PATCH 1/3] openmp: Refactor handling of iterators

2024-05-24 Thread Kwok Cheung Yeung
This patch factors out the code to calculate the number of iterations required and to generate the iteration loop into separate functions from gimplify_omp_depend for reuse later. I have also replaced the 'TREE_CODE (*tp) == TREE_LIST && ...' checks used for detecting an iterator clause with a

[PATCH 2/3] openmp: Add support for iterators in map clauses (C/C++)

2024-05-24 Thread Kwok Cheung Yeung
This patch modifies the C and C++ parsers to accept an iterator as a map type modifier, encoded in the same way as the depend and affinity clauses. When finishing the clauses, clauses with iterators are treated separately from ones without to avoid clashes (e.g. iterating over x[i] will likely

[PATCH 3/3] openmp: Add support for iterators in to/from clauses (C/C++)

2024-05-24 Thread Kwok Cheung Yeung
This patch extends the previous patch to cover to/from clauses in 'target update'.From 99addc124535307b50fbdeb66c4f90bb0cbeb041 Mon Sep 17 00:00:00 2001 From: Kwok Cheung Yeung Date: Mon, 15 Apr 2024 13:50:22 +0100 Subject: [PATCH 3/3] openmp: Add support for iterators in to/from clauses (C/C++)

Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Robin Dapp
> * -mstrict-align: Both scalar and vector misaligned accesses are > unsupported (-mrvv-allow-misalign doesn't matter). I'm not sure if > there's hardware there, but given we have systems that don't support > scalar misaligned accesses it seems reasonable to assume they'll also > not support vecto

Re: [PATCH 2/13] rs6000, Remove __builtin_vsx_xvcvspsxws built-in

2024-05-24 Thread Carl Love
Kewen: On 5/14/24 01:43, Kewen.Lin wrote: > Hi, > > on 2024/4/20 05:17, Carl Love wrote: >> rs6000, Remove __builtin_vsx_xvcvspsxws built-in >> >> The built-in __builtin_vsx_xvcvspsxws is a duplicate of the vec_signed >> built-in that is documented in the PVIPR. The __builtin_vsx_xvcvspsxws >> b

Re: [PATCH 4/13] rs6000, extend the current vec_{un,}signed{e,o} built-ins

2024-05-24 Thread Carl Love
Kewen: On 5/14/24 00:53, Kewen.Lin wrote: > Hi, > > on 2024/4/20 05:17, Carl Love wrote: >> rs6000, extend the current vec_{un,}signed{e,o} built-ins >> >> The built-ins __builtin_vsx_xvcvspsxds and __builtin_vsx_xvcvspuxds >> convert a vector of floats to signed/unsigned long long ints. Extend

Re: [PATCH 3/13] rs6000, fix error in unsigned vector float to unsigned int built-in definitions

2024-05-24 Thread Carl Love
Keewn: On 5/14/24 00:00, Kewen.Lin wrote: > Hi, > > on 2024/4/20 05:17, Carl Love wrote: >> rs6000, fix error in unsigned vector float to unsigned int built-in >> definitions >> >> The built-ins __builtin_vsx_vunsigned_v2df and__builtin_vsx_vunsigned_v4sf >> are supposed to take a vector of flo

Re: [PATCH 7/13] rs6000, remove the vec_xxsel built-ins, they are duplicates

2024-05-24 Thread Carl Love
Kewen: On 5/13/24 19:55, Kewen.Lin wrote: > Hi, > > on 2024/4/20 05:18, Carl Love wrote: >> rs6000, remove the vec_xxsel built-ins, they are duplicates >> -int do_sel(void) >> -{ >> - int i = 0; >> - >> - si[i][0] = __builtin_vsx_xxsel_4si (si[i][1], si[i][2], si[i][3]); i++;

Re: [PATCH 11/13] rs6000, remove __builtin_vsx_xvcmpeqsp_p built-in

2024-05-24 Thread Carl Love
On 5/13/24 22:26, Kewen.Lin wrote: > Hi, > > on 2024/4/20 05:18, Carl Love wrote: >> rs6000, remove __builtin_vsx_xvcmpeqsp_p built-in >> >> The built-in __builtin_vsx_xvcmpeqsp_p is a duplicate of the overloaded >> __builtin_altivec_vcmpeqfp_p built-in. The built-in is undocumented and >> the

Re: [PATCH 6/13] rs6000, add overloaded vec_sel with int128 arguments

2024-05-24 Thread Carl Love
Kewen: On 5/21/24 20:05, Kewen.Lin wrote: > Hi Carl, > > on 2024/5/22 08:13, Carl Love wrote: >> Kewen: >>> Why did you place this in a section for ISA 3.1 (Power10)? It doesn't >>> really >>> require this support. The used instance VSEL_1TI and VSEL_1TI_UNS are >>> placed >>> in altivec s

Re: [PATCH 8/13] rs6000, remove __builtin_vsx_vperm_* built-ins

2024-05-24 Thread Carl Love
Kewen: On 5/13/24 19:59, Kewen.Lin wrote: > Hi, > > on 2024/4/20 05:18, Carl Love wrote: >> diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-builtin-3.c >> b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-3.c >> index 01f35dad713..35ea31b2616 100644 >> --- a/gcc/testsuite/gcc.target/powerpc/vs

Re: [PATCH 10/13] rs6000, extend vec_xxpermdi built-in for __int128 args

2024-05-24 Thread Carl Love
On 5/13/24 22:14, Kewen.Lin wrote: > Hi, > > on 2024/4/20 05:18, Carl Love wrote: >> rs6000, extend vec_xxpermdi built-in for __int128 args >> >> Add a new overloaded instance for vec_xxpermdi >> >>__int128 vec_xxpermdi (__int128, __int128, const int); >> >> Update the documentation to incl

[pushed] wwwdocs: gcc-13: Run time instead of runtime

2024-05-24 Thread Gerald Pfeifer
Per our codingconventions.html Gerald --- htdocs/gcc-13/changes.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html index d431c768..2702170d 100644 --- a/htdocs/gcc-13/changes.html +++ b/htdocs/gcc-13/changes.html @

Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Jeff Law
On 5/24/24 11:14 AM, Palmer Dabbelt wrote: On Fri, 24 May 2024 09:19:09 PDT (-0700), Robin Dapp wrote: We should have something in doc/invoke too, this one is going to be tricky for users.  We'll also have to define how this interacts with the existing -mstrict-align. Addressed the rest in

Re: [PATCH] RISC-V: Avoid splitting store dataref groups during SLP discovery

2024-05-24 Thread Jeff Law
On 5/23/24 11:52 PM, Richard Biener wrote: This worked out so I pushed the change. The gcc.dg/vect/pr97428.c test is FAILing on RISC-V (it still gets 0 SLP), because of missed load permutations. I hope the followup reorg for the load side will fix this. It also FAILs gcc.target/riscv/rvv/

Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Palmer Dabbelt
On Fri, 24 May 2024 16:31:48 PDT (-0700), jeffreya...@gmail.com wrote: On 5/24/24 11:14 AM, Palmer Dabbelt wrote: On Fri, 24 May 2024 09:19:09 PDT (-0700), Robin Dapp wrote: We should have something in doc/invoke too, this one is going to be tricky for users.  We'll also have to define how th

Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Jeff Law
On 5/24/24 5:39 PM, Palmer Dabbelt wrote: On Fri, 24 May 2024 16:31:48 PDT (-0700), jeffreya...@gmail.com wrote: On 5/24/24 11:14 AM, Palmer Dabbelt wrote: On Fri, 24 May 2024 09:19:09 PDT (-0700), Robin Dapp wrote: We should have something in doc/invoke too, this one is going to be trick

Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Palmer Dabbelt
On Fri, 24 May 2024 16:41:39 PDT (-0700), jeffreya...@gmail.com wrote: On 5/24/24 5:39 PM, Palmer Dabbelt wrote: On Fri, 24 May 2024 16:31:48 PDT (-0700), jeffreya...@gmail.com wrote: On 5/24/24 11:14 AM, Palmer Dabbelt wrote: On Fri, 24 May 2024 09:19:09 PDT (-0700), Robin Dapp wrote: We

Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Jeff Law
On 5/24/24 5:43 PM, Palmer Dabbelt wrote: I'm only reading Zicclsm as saying both scalar and vector misaligned accesses are supported, but nothing about the performance. I think it was in the vector docs.  It didn't say anything about performance, just a note that scalar & vector behavior c

Re: [PATCH v2] RISC-V: Introduce -mrvv-allow-misalign.

2024-05-24 Thread Palmer Dabbelt
On Fri, 24 May 2024 16:50:52 PDT (-0700), jeffreya...@gmail.com wrote: On 5/24/24 5:43 PM, Palmer Dabbelt wrote: I'm only reading Zicclsm as saying both scalar and vector misaligned accesses are supported, but nothing about the performance. I think it was in the vector docs.  It didn't say

Re: [RFC/RFA][PATCH 00/12] CRC optimization

2024-05-24 Thread Jeff Law
On 5/24/24 2:41 AM, Mariam Arutunian wrote: Hello! This patch set detects bitwise CRC implementation loops (with branches) in the GIMPLE optimizers and replaces them with more optimal CRC implementations in RTL. These patches introduce new internal functions, built-in functions, and expand

Re: [PATCH v8] Introduce attribute sym_alias

2024-05-24 Thread Alexandre Oliva
On Dec 5, 2023, Alexandre Oliva wrote: > Here's an improved version that fixes some cases of making static local > names visible through sym_alias, detection of symbol name clashes when > sym_alias is registered before a clashing definition ("sym name" > attributes are now introduced to enable s