[PATCH] Fix expectation on gcc.dg/vect/pr71264.c

2023-07-05 Thread Richard Biener via Gcc-patches
With the recent change to more reliably not vectorize code already using vector types we run into FAILs of gcc.dg/vect/pr71264.c The testcase was added for fixing an ICE and possible (re-)vectorization of the code isn't really supported and I suspect might even go wrong for non-bitops. The followi

Re: Re: [PATCH] VECT: Fix ICE of variable stride on strieded load/store with SELECT_VL loop control.

2023-07-05 Thread juzhe.zh...@rivai.ai
Thank you so much. I have sent V2: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/623734.html which is working fine for both stride = constant and variable. Could you take a look at it? Thanks. juzhe.zh...@rivai.ai From: Richard Biener Date: 2023-07-06 14:43 To: Ju-Zhe Zhong CC: gcc-p

[PATCH V2] VECT: Fix ICE of variable stride on strieded load/store with SELECT_VL loop control.

2023-07-05 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richi. Sorry for making mistake on LEN_MASK_GATHER_LOAD/LEN_MASK_SCATTER_STORE with SELECT_VL loop control. Consider this following case: #define TEST_LOOP(DATA_TYPE, BITS) \ void __attribute__ ((noinline, noclone))

Re: [PATCH 10/11] riscv: thead: Add support for the XTheadMemIdx ISA extension

2023-07-05 Thread Christoph Müllner
On Thu, Jun 29, 2023 at 4:09 PM Jeff Law wrote: > > > > On 6/29/23 01:39, Christoph Müllner wrote: > > On Wed, Jun 28, 2023 at 8:23 PM Jeff Law wrote: > >> > >> > >> > >> On 6/28/23 06:39, Christoph Müllner wrote: > >> > > +;; XTheadMemIdx overview: > > +;; All peephole passes attempt to

Re: [PATCH] VECT: Fix ICE of variable stride on strieded load/store with SELECT_VL loop control.

2023-07-05 Thread Richard Biener via Gcc-patches
On Thu, 6 Jul 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Hi, Richi. > > Sorry for making mistake on LEN_MASK_GATHER_LOAD/LEN_MASK_SCATTER_STORE > with SELECT_VL loop control. > > Consider this following case: > #define TEST_LOOP(DATA_TYPE, BITS)

[PATCH] Initial Granite Rapids D Support

2023-07-05 Thread Mo, Zewei via Gcc-patches
Hi all, This patch is to add initial support for Granite Rapids D for GCC. The link of related information is listed below: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html Also, the patch of removing AMX-COMPLEX fro

[PATCH] i386: Update document for inlining rules

2023-07-05 Thread Hongyu Wang via Gcc-patches
Hi, This is a follow-up patch for https://gcc.gnu.org/pipermail/gcc-patches/2023-July/623525.html that updates document about x86 inlining rules. Ok for trunk? gcc/ChangeLog: * doc/extend.texi: Move x86 inlining rule to a new subsubsection and add description for inling of funct

Re: [PATCH] x86: Properly find the maximum stack slot alignment

2023-07-05 Thread Richard Biener via Gcc-patches
On Thu, Jul 6, 2023 at 1:28 AM H.J. Lu via Gcc-patches wrote: > > Don't assume that stack slots can only be accessed by stack or frame > registers. Also check memory accesses from registers defined by > stack or frame registers. > > gcc/ > > PR target/109780 > * config/i386/i386.c

Re: [PATCH] RISC-V: Handle rouding mode correctly on zfinx

2023-07-05 Thread Kito Cheng via Gcc-patches
Committed to trunk, and plan to back port to GCC 13 branch 1 week later :) On Wed, Jul 5, 2023 at 10:15 PM Jeff Law wrote: > > > > On 7/5/23 02:11, Kito Cheng wrote: > > Zfinx has provide fcsr like F, so rouding mode should use fcsr instead > > of `soft` fenv. > > > > libgcc/ChangeLog: > > > >

Re: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 11:15 PM Eugene Rozenfeld wrote: > > There is no warning and perf /uk succeeds when kptr_restrict is set to 1 and > perf_event_paranoid set to 2. However, create_gcov may fail since it won't be > able to understand kernel addresses and it requires at least 95% of events to

Re: [PATCH 1/2] [x86] Add pre_reload splitter to detect fp min/max pattern.

2023-07-05 Thread Uros Bizjak via Gcc-patches
On Thu, Jul 6, 2023 at 3:20 AM liuhongt wrote: > > We have ix86_expand_sse_fp_minmax to detect min/max sematics, but > it requires rtx_equal_p for cmp_op0/cmp_op1 and if_true/if_false, for > the testcase in the PR, there's an extra move from cmp_op0 to if_true, > and it failed ix86_expand_sse_fp_m

[PATCH] VECT: Fix ICE of variable stride on strieded load/store with SELECT_VL loop control.

2023-07-05 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richi. Sorry for making mistake on LEN_MASK_GATHER_LOAD/LEN_MASK_SCATTER_STORE with SELECT_VL loop control. Consider this following case: #define TEST_LOOP(DATA_TYPE, BITS) \ void __attribute__ ((noinline, noclone))

Re: [PATCH] Fix PR 110554: vec lowering introduces scalar signed-boolean:32 comparisons

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 7:02 PM Andrew Pinski via Gcc-patches wrote: > > So the problem is vector generic decided to do comparisons in > signed-boolean:32 > types but the rest of the middle-end was not ready for that. Since we are > building > the comparison which will feed into a cond_expr here,

Re: GGC, GTY: No pointer walking for 'atomic' in PCH 'gt_pch_note_object' (was: Patch: New GTY ((atomic)) option)

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 6:25 PM Thomas Schwinge wrote: > > Hi! > > My original motivation for the following exercise what that, for example, > for: 'const unsigned char * GTY((atomic)) mode_table', we currently run > into 'const' mismatches, 'error: invalid conversion': > > [...] > gtype-de

Re: GGC, GTY: Tighten up a few things re 'reorder' option and strings

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 6:16 PM Thomas Schwinge wrote: > > Hi! > > OK to push the attached > "GGC, GTY: Tighten up a few things re 'reorder' option and strings"? OK. > > Grüße > Thomas > > > - > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 > Münc

Re: [v2] GTY: Clean up obsolete parametrized structs remnants (was: [PATCH 3/3] remove gengtype support for param_is use_param, if_marked and splay tree allocators)

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 6:13 PM Thomas Schwinge wrote: > > Hi! > > On 2023-07-05T10:16:09+0200, I wrote: > > On 2014-11-23T23:11:36-0500, tsaund...@mozilla.com wrote: > >> gcc/ > >> > >> * plugin.c, plugin.def, ggc.h, ggc-common.c, gengtype.h, gengtype.c, > >> gengtype-state.c, gengtype

Re: GTY: Repair 'enum gty_token', 'token_names' desynchronization (was: [cxx-conversion] Support garbage-collected C++ templates)

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 12:21 PM Thomas Schwinge wrote: > > Hi! > > On 2012-08-10T11:06:46-0400, Diego Novillo wrote: > > * gengtype-lex.l (USER_GTY): Add pattern for "user". > > * gengtype-parse.c (option): Handle USER_GTY. > > (opts_have): New. > > (type): Cal

Re: [PATCH 2/2] Adjust rtx_cost for DF/SFmode AND/IOR/XOR/ANDN operations.

2023-07-05 Thread Uros Bizjak via Gcc-patches
On Thu, Jul 6, 2023 at 3:20 AM liuhongt wrote: > > They should have same cost as vector mode since both generate > pand/pandn/pxor/por instruction. > > Bootstrapped and regtested on x86_64-pc-linu-gnu{-m32,}. > Ok for trunk? > > gcc/ChangeLog: > > * config/i386/i386.cc (ix86_rtx_costs): Ad

Re: [PATCH] Disparage slightly for the alternative which move DFmode between SSE_REGS and GENERAL_REGS.

2023-07-05 Thread Uros Bizjak via Gcc-patches
On Thu, Jul 6, 2023 at 3:14 AM liuhongt wrote: > > For testcase > > void __cond_swap(double* __x, double* __y) { > bool __r = (*__x < *__y); > auto __tmp = __r ? *__x : *__y; > *__y = __r ? *__y : *__x; > *__x = __tmp; > } > > GCC-14 with -O2 and -march=x86-64 options generates the followi

[PATCH v5] RISC-V: Fix one bug for floating-point static frm

2023-07-05 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to fix one bug to align below items of spec. RVV floating-point instructions always (implicitly) use the dynamic rounding mode. This implies that rounding is performed according to the rounding mode set in the FRM register. The FRM register itself only holds

[PATCH 1/2] [x86] Add pre_reload splitter to detect fp min/max pattern.

2023-07-05 Thread liuhongt via Gcc-patches
We have ix86_expand_sse_fp_minmax to detect min/max sematics, but it requires rtx_equal_p for cmp_op0/cmp_op1 and if_true/if_false, for the testcase in the PR, there's an extra move from cmp_op0 to if_true, and it failed ix86_expand_sse_fp_minmax. This patch adds pre_reload splitter to detect the

[PATCH 2/2] Adjust rtx_cost for DF/SFmode AND/IOR/XOR/ANDN operations.

2023-07-05 Thread liuhongt via Gcc-patches
They should have same cost as vector mode since both generate pand/pandn/pxor/por instruction. Bootstrapped and regtested on x86_64-pc-linu-gnu{-m32,}. Ok for trunk? gcc/ChangeLog: * config/i386/i386.cc (ix86_rtx_costs): Adjust rtx_cost for DF/SFmode AND/IOR/XOR/ANDN operations.

[PATCH] Disparage slightly for the alternative which move DFmode between SSE_REGS and GENERAL_REGS.

2023-07-05 Thread liuhongt via Gcc-patches
For testcase void __cond_swap(double* __x, double* __y) { bool __r = (*__x < *__y); auto __tmp = __r ? *__x : *__y; *__y = __r ? *__y : *__x; *__x = __tmp; } GCC-14 with -O2 and -march=x86-64 options generates the following code: __cond_swap(double*, double*): movsd xmm1, QWORD

Re: [PATCH V2] i386: Inline function with default arch/tune to caller

2023-07-05 Thread Hongyu Wang via Gcc-patches
Thanks, this is the updated patch I'm going to check in. Uros Bizjak 于2023年7月4日周二 16:57写道: > > On Tue, Jul 4, 2023 at 10:32 AM Hongyu Wang wrote: > > > > > In a follow-up patch, can you please document inlining rules involving > > > -march and -mtune to "x86 Function Attributes" section? Current

[PATCH] x86: Properly find the maximum stack slot alignment

2023-07-05 Thread H.J. Lu via Gcc-patches
Don't assume that stack slots can only be accessed by stack or frame registers. Also check memory accesses from registers defined by stack or frame registers. gcc/ PR target/109780 * config/i386/i386.cc (ix86_set_with_register_source): New. (ix86_find_all_stack_access): L

[COMMITTED 5/5] Make compute_operand_range a tail call.

2023-07-05 Thread Andrew MacLeod via Gcc-patches
This simply tweaks cmpute_operand_range a little so the recursion is a tail call. With this, the patchset produces a modest speedup of 0.2% in VRP and 0.4% in threading.  It will also have a much smaller stack profile. Bootstraps on  x86_64-pc-linux-gnu  with no regressions.  Pushed. Andrew

[COMMITTED 4/5] Make compute_operand2_range a leaf call.

2023-07-05 Thread Andrew MacLeod via Gcc-patches
now operand2 alone is resolved, and returned as the result.  much cleaner, and removes it from the recursion stack. compute_operand_range() will decide if further evaluation is required. Bootstraps on  x86_64-pc-linux-gnu  with no regressions.  Pushed. Andrew From 298952bcf05d298892e99adba1f4a

[COMMITTED 3/5] Make compute_operand1_range a leaf call.

2023-07-05 Thread Andrew MacLeod via Gcc-patches
now operand1 alone is resolved, and returned as the result.  much cleaner, and removes it from the recursion stack. compute_operand_range() will decide if further evaluation is required. Bootstraps on  x86_64-pc-linux-gnu  with no regressions.  Pushed. Andrew From 912b5ac49677160aada7a2d86227

[COMMITTED 2/5] Simplify compute_operand_range for op1 and op2 case.

2023-07-05 Thread Andrew MacLeod via Gcc-patches
This patch simplifies compute_operand1_and_operand2() such that it only calls each routine one. This will simplify the next couple of patches. It also allows moves the determination that op1 and op2 have an interdependence to  compute_operand_range(). Bootstraps on  x86_64-pc-linux-gnu  with

[COMMITTED 1/5] Move relation discovery into compute_operand_range

2023-07-05 Thread Andrew MacLeod via Gcc-patches
This is a set of 5 patches which cleans up GORIs compute_operand routines. This is the mechanism GORI uses to calculate ranges from the bottom of the routine back thru definitions in the block to the name that is requested. Currently, compute_operand_range() is called on a stmt, and it divide

Re: [PATCH] libstdc++: Split up pstl/set.cc testcase

2023-07-05 Thread Thomas Rodgers via Gcc-patches
Comment added to each file. Tested x86_64-linux. Pushed to trunk. On Mon, Jul 3, 2023 at 4:16 PM Jonathan Wakely wrote: > On Mon, 3 Jul 2023 at 23:14, Thomas Rodgers via Libstdc++ > wrote: > > > > This testcase is causing some timeout issues. This patch splits the > > testcase up by individual

Re: [PATCH] analyzer: Add support of placement new and improved operator new [PR105948]

2023-07-05 Thread Benjamin Priour via Gcc-patches
Hi David, On 05/07/2023 22:59, David Malcolm wrote: diff --git a/gcc/analyzer/kf-lang-cp.cc b/gcc/analyzer/kf-lang-cp.cc index 393b4f25e79..258d92919d7 100644 --- a/gcc/analyzer/kf-lang-cp.cc +++ b/gcc/analyzer/kf-lang-cp.cc @@ -35,6 +35,34 @@ along with GCC; see the file COPYING3. If not see

[PATCH] testsuite: fix dwarf2/utf-1.C with DWARF4

2023-07-05 Thread Marek Polacek via Gcc-patches
Running $ make check-c++ RUNTESTFLAGS='--target_board=unix\{-gdwarf-5,-gdwarf-4\} dwarf2.exp=utf-1.C' shows FAIL: g++.dg/debug/dwarf2/utf-1.C -std=gnu++20 scan-assembler-times DW_AT_encoding \\(0x10\\) 3 because with -gdwarf-4 the output is: .byte 0x10# DW_AT_encoding but with -gdwarf

RE: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-07-05 Thread Eugene Rozenfeld via Gcc-patches
There is no warning and perf /uk succeeds when kptr_restrict is set to 1 and perf_event_paranoid set to 2. However, create_gcov may fail since it won't be able to understand kernel addresses and it requires at least 95% of events to be successfully mapped. If I set both kptr_restrict and perf_e

Re: [PATCH] analyzer: Add support of placement new and improved operator new [PR105948]

2023-07-05 Thread David Malcolm via Gcc-patches
On Tue, 2023-07-04 at 18:25 +0200, priour...@gmail.com wrote: > From: benjamin priour > > Script contrib/check_GNU_style.sh complains about there being a space > before a left square bracket ("operator new []"). > Though, it is actually within a literal string, and the space  > is required to co

Re: [PATCH] Fortran: fixes for procedures with ALLOCATABLE,INTENT(OUT) arguments [PR92178]

2023-07-05 Thread Harald Anlauf via Gcc-patches
Hi Mikael, Am 05.07.23 um 16:54 schrieb Mikael Morin: Here is an example, admittedly artificial.  Fails with the above change, but fails with master as well. program p   implicit none   type t     integer :: i   end type t   type u     class(t), allocatable :: ta(:)   end type u   type(

Re: [PATCH] Vect: select small VF for epilog of unrolled loop (PR tree-optimization/110474)

2023-07-05 Thread Richard Sandiford via Gcc-patches
Hao Liu OS via Gcc-patches writes: > Hi, > > If a loop is unrolled during vectorization (i.e. suggested_unroll_factor > 1), > the VFs of both main and epilog loop are enlarged. The epilog vect loop is > specific for a loop with small iteration counts, so a large VF may hurt > performance. > > Thi

Re: Re: [PATCH] libstdc++: Fix fwrite error parameter

2023-07-05 Thread Tianqiang Shuai via Gcc-patches
Thanks a lot.

Re: [PATCH] libatomic: Enable lock-free 128-bit atomics on AArch64 [PR110061]

2023-07-05 Thread Wilco Dijkstra via Gcc-patches
ping From: Wilco Dijkstra Sent: 02 June 2023 18:28 To: GCC Patches Cc: Richard Sandiford ; Kyrylo Tkachov Subject: [PATCH] libatomic: Enable lock-free 128-bit atomics on AArch64 [PR110061]   Enable lock-free 128-bit atomics on AArch64.  This is backwards compatible with existing binaries, g

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

2023-07-05 Thread Kyrylo Tkachov via Gcc-patches
Hi Christophe, > -Original Message- > From: Christophe Lyon > Sent: Monday, June 26, 2023 4:03 PM > To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov ; > Richard Sandiford > Cc: Christophe Lyon > Subject: [PATCH] arm: Fix MVE intrinsics support with LTO (PR target/110268) > > After the recen

[PATCH] Fix PR 110554: vec lowering introduces scalar signed-boolean:32 comparisons

2023-07-05 Thread Andrew Pinski via Gcc-patches
So the problem is vector generic decided to do comparisons in signed-boolean:32 types but the rest of the middle-end was not ready for that. Since we are building the comparison which will feed into a cond_expr here, using boolean_type_node is better and also correct. The rest of the compiler thin

GGC, GTY: No pointer walking for 'atomic' in PCH 'gt_pch_note_object' (was: Patch: New GTY ((atomic)) option)

2023-07-05 Thread Thomas Schwinge
Hi! My original motivation for the following exercise what that, for example, for: 'const unsigned char * GTY((atomic)) mode_table', we currently run into 'const' mismatches, 'error: invalid conversion': [...] gtype-desc.cc: In function 'void gt_pch_nx_lto_file_decl_data(void*)': gtyp

[PATCH] doc: Update my Contributors entry

2023-07-05 Thread Jonathan Wakely via Gcc-patches
Gerald suggested I update this. Pushed to trunk. -- >8 -- gcc/ChangeLog: * doc/contrib.texi (Contributors): Update my entry. --- gcc/doc/contrib.texi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi index 758805dc5db..fa55

GGC, GTY: Tighten up a few things re 'reorder' option and strings

2023-07-05 Thread Thomas Schwinge
Hi! OK to push the attached "GGC, GTY: Tighten up a few things re 'reorder' option and strings"? Grüße Thomas - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Fran

Re: [PATCH 2/2] arm: Add support for MVE Tail-Predicated Low Overhead Loops

2023-07-05 Thread Stamatis Markianos-Wright via Gcc-patches
On 23/06/2023 11:23, Andre Vieira (lists) wrote: +  if (insn != arm_mve_get_loop_vctp (body)) +    { probably a good idea to invert the condition here and return false, helps reducing the indenting in this function. Done, thanks +    /* Starting from the current insn, scan backwards th

[v2] GTY: Clean up obsolete parametrized structs remnants (was: [PATCH 3/3] remove gengtype support for param_is use_param, if_marked and splay tree allocators)

2023-07-05 Thread Thomas Schwinge
Hi! On 2023-07-05T10:16:09+0200, I wrote: > On 2014-11-23T23:11:36-0500, tsaund...@mozilla.com wrote: >> gcc/ >> >> * plugin.c, plugin.def, ggc.h, ggc-common.c, gengtype.h, gengtype.c, >> gengtype-state.c, gengtype-parse.c, gentype-lex.l, gcc-plugin.h, >> doc/plugins.texi, doc/gt

Re: [PATCH 2/2] arm: Add support for MVE Tail-Predicated Low Overhead Loops

2023-07-05 Thread Stamatis Markianos-Wright via Gcc-patches
Thank you Andre for reviewing! I'll attach the updated version of the patch to the third review email (your final one thus far ;) On 22/06/2023 16:54, Andre Vieira (lists) wrote: Some comments below, all quite minor. I'll continue to review tomorrow, I need a fresher brain for arm_mve_check_df

Re: [PATCH] libstdc++: Fix fwrite error parameter

2023-07-05 Thread Jonathan Wakely via Gcc-patches
On Wed, 5 Jul 2023 at 16:54, shuaitq via Libstdc++ wrote: > > the first parameter of fwrite should be the const char* __s which want write > to FILE *__file, > rather than the FILE *__file write to the FILE *__file. Thank you. The patch is correct and small enough to not require a copyright assi

[PATCH] libstdc++: Fix fwrite error parameter

2023-07-05 Thread Tianqiang Shuai via Gcc-patches
the first parameter of fwrite should be the const char* __s which want write to FILE *__file, rather than the FILE *__file write to the FILE *__file. 0001-Fix-fwrite-error-parameter.txt Description: Binary data

[PATCH] libstdc++: Fix fwrite error parameter

2023-07-05 Thread Tianqiang Shuai via Gcc-patches
the first parameter of fwrite should be the const char* __s which want write to FILE *__file, rather than the FILE *__file write to the FILE *__file. 0001-Fix-fwrite-error-parameter.txt Description: Binary data

[PATCH] libstdc++: Fix fwrite error parameter

2023-07-05 Thread shuaitq via Gcc-patches
the first parameter of fwrite should be the const char* __s which want write to FILE *__file, rather than the FILE *__file write to the FILE *__file. 0001-Fix-fwrite-error-parameter.txt Description: Binary data

[committed] sched: Change return type of predicate functions from int to bool

2023-07-05 Thread Uros Bizjak via Gcc-patches
Also change some internal variables to bool. gcc/ChangeLog: * sched-int.h (struct haifa_sched_info): Change can_schedule_ready_p, scehdule_more_p and contributes_to_priority indirect frunction type from int to bool. (no_real_insns_p): Change return type from int to bool. (cont

Re: [PATCH] Fortran: fixes for procedures with ALLOCATABLE,INTENT(OUT) arguments [PR92178]

2023-07-05 Thread Mikael Morin
Le 04/07/2023 à 21:37, Mikael Morin a écrit : Le 04/07/2023 à 21:00, Harald Anlauf a écrit : Hi Mikael, all, I think I've found it: there is a call to gfc_conv_class_to_class that - according to a comment - does a repackaging to a class array. Deferring that repackaging along with the deallocat

RE: [PATCH v1] RISC-V: Use FRM_DYN when add the rounding mode operand

2023-07-05 Thread Li, Pan2 via Gcc-patches
Committed, thanks Juzhe and Kito. Pan -Original Message- From: Kito Cheng Sent: Wednesday, July 5, 2023 3:16 PM To: juzhe.zh...@rivai.ai Cc: Li, Pan2 ; gcc-patches ; Robin Dapp ; jeffreyalaw ; Wang, Yanzhang Subject: Re: [PATCH v1] RISC-V: Use FRM_DYN when add the rounding mode opera

Re: [PATCH] RISC-V: Allow variable index for vec_set.

2023-07-05 Thread Jeff Law via Gcc-patches
On 7/5/23 03:12, Robin Dapp wrote: Hi, this patch enables a variable index for vec_set and adjusts/cleans up the tests. Regards Robin gcc/ChangeLog: * config/riscv/autovec.md: Allow register index operand. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vls-vlma

Re: [PATCH] RISC-V: Handle rouding mode correctly on zfinx

2023-07-05 Thread Jeff Law via Gcc-patches
On 7/5/23 02:11, Kito Cheng wrote: Zfinx has provide fcsr like F, so rouding mode should use fcsr instead of `soft` fenv. libgcc/ChangeLog: * config/riscv/sfp-machine.h (FP_INIT_ROUNDMODE): Check zfinx. (FP_HANDLE_EXCEPTIONS): Ditto. OK jeff

Re: [PATCH] RISC-V: Support variable index in vec_extract.

2023-07-05 Thread Jeff Law via Gcc-patches
On 7/5/23 03:13, Robin Dapp wrote: Hi, this patch adds a gen_lowpart in the vec_extract expander so it properly works with a variable index and adds tests. Regards Robin gcc/ChangeLog: * config/riscv/autovec.md: Add gen_lowpart. gcc/testsuite/ChangeLog: * gcc.target/ris

Re: [PATCH][RFC] target/110456 - avoid loop masking with zero distance dependences

2023-07-05 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Tue, 4 Jul 2023, Richard Sandiford wrote: > >> Richard Biener writes: >> > On Thu, 29 Jun 2023, Richard Biener wrote: >> > >> >> On Thu, 29 Jun 2023, Richard Sandiford wrote: >> >> >> >> > Richard Biener writes: >> >> > > With applying loop masking to epilogues on x8

Re: [PATCH] Add -Wmissing-variable-declarations [PR65213].

2023-07-05 Thread Hamza Mahfooz
Ping? On Tue, Jun 13 2023 at 09:05:29 AM -04:00:00, Hamza Mahfooz wrote: Resolves: PR c/65213 - Extend -Wmissing-declarations to variables [i.e. add -Wmissing-variable-declarations] gcc/c-family/ChangeLog: PR c/65213 * c.opt (-Wmissing-variable-declarations): New option. gcc

Re: [PATCH] RISC-V: Change truncate to float_truncate in narrowing

2023-07-05 Thread Kito Cheng via Gcc-patches
Lgtm juzhe.zh...@rivai.ai 於 2023年7月5日 週三,21:04寫道: > LGTM. Thanks for fixing this. > > > > juzhe.zh...@rivai.ai > > From: Robin Dapp > Date: 2023-07-05 21:00 > To: gcc-patches; palmer; Kito Cheng; juzhe.zh...@rivai.ai; jeffreyalaw > CC: rdapp.gcc > Subject: [PATCH] RISC-V: Change truncate to float

[PATCH] match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]

2023-07-05 Thread Drew Ross via Gcc-patches
Adds a simplification for (~X | Y) ^ X to be folded into ~(X & Y). Tested successfully on x86_64 and x86 targets. PR middle-end/109986 gcc/ChangeLog: * match.pd ((~X | Y) ^ X -> ~(X & Y)): New simplification. gcc/testsuite/ChangeLog: * gcc.c-

RE: [PATCH V5] VECT: Apply LEN_MASK_GATHER_LOAD/SCATTER_STORE into vectorizer

2023-07-05 Thread Li, Pan2 via Gcc-patches
Committed, thanks Richard. Pan -Original Message- From: Gcc-patches On Behalf Of Richard Biener via Gcc-patches Sent: Wednesday, July 5, 2023 9:21 PM To: Ju-Zhe Zhong Cc: gcc-patches@gcc.gnu.org; richard.sandif...@arm.com Subject: Re: [PATCH V5] VECT: Apply LEN_MASK_GATHER_LOAD/SCATTER

Re: [PATCH][RFC] target/110456 - avoid loop masking with zero distance dependences

2023-07-05 Thread Richard Biener via Gcc-patches
On Tue, 4 Jul 2023, Richard Sandiford wrote: > Richard Biener writes: > > On Thu, 29 Jun 2023, Richard Biener wrote: > > > >> On Thu, 29 Jun 2023, Richard Sandiford wrote: > >> > >> > Richard Biener writes: > >> > > With applying loop masking to epilogues on x86_64 AVX512 we see > >> > > some s

Re: [PATCH V5] VECT: Apply LEN_MASK_GATHER_LOAD/SCATTER_STORE into vectorizer

2023-07-05 Thread Richard Biener via Gcc-patches
On Tue, 4 Jul 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Hi, Richard and Richi. > > Address comments from Richi. > > Make gs_info.ifn = LEN_MASK_GATHER_LOAD/LEN_MASK_SCATTER_STORE. > > I have fully tested these 4 format: > > length = vf is a dummpy length, > mask = {-1,-1, ..

Re: [PATCH] RISC-V: Change truncate to float_truncate in narrowing

2023-07-05 Thread juzhe.zh...@rivai.ai
LGTM. Thanks for fixing this. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-07-05 21:00 To: gcc-patches; palmer; Kito Cheng; juzhe.zh...@rivai.ai; jeffreyalaw CC: rdapp.gcc Subject: [PATCH] RISC-V: Change truncate to float_truncate in narrowing Hi, Juzhe noticed that several floating-poin

[PATCH] RISC-V: Change truncate to float_truncate in narrowing

2023-07-05 Thread Robin Dapp via Gcc-patches
Hi, Juzhe noticed that several floating-point conversion tests FAIL on 32 bit. This is due to the autovect FP narrowing patterns using a truncate instead of a float_truncate which results in a combine ICE. It would try to e.g. simplify a unary operation by simplify_const_unary_operation which ob

Re: [PATCH v1 0/6] Add Loongson SX/ASX instruction support to LoongArch target.

2023-07-05 Thread Xi Ruoyao via Gcc-patches
A question: is vld/vst guaranteed to be atomic if the accessed address is aligned? If true we can use them to implement lock-free 128-bit atomic load and store. See https://gcc.gnu.org/bugzilla/PR104688 for the background, and some people really hate using a lock for atomics. On Fri, 2023-06-30

[PATCH] rs6000: Don't ICE when generating vector pair load/store insns [PR110411]

2023-07-05 Thread P Jeevitha via Gcc-patches
Hi All, The following patch has been bootstrapped and regtested on powerpc64le-linux. while generating vector pairs of load & store instruction, the src address was treated as an altivec type and that type of address is invalid for lxvp and stxvp insns. The solution for this is to avoid altivec

Re: RE: [PATCH V5] VECT: Apply LEN_MASK_GATHER_LOAD/SCATTER_STORE into vectorizer

2023-07-05 Thread juzhe.zh...@rivai.ai
Thank you for using intel's machines test it for me. juzhe.zh...@rivai.ai From: Li, Pan2 Date: 2023-07-05 19:15 To: juzhe.zh...@rivai.ai; gcc-patches@gcc.gnu.org CC: richard.sandif...@arm.com; rguent...@suse.de Subject: RE: [PATCH V5] VECT: Apply LEN_MASK_GATHER_LOAD/SCATTER_STORE into vector

RE: [PATCH V5] VECT: Apply LEN_MASK_GATHER_LOAD/SCATTER_STORE into vectorizer

2023-07-05 Thread Li, Pan2 via Gcc-patches
Passed both the bootstrap and regression tests in X86. Pan -Original Message- From: Gcc-patches On Behalf Of juzhe.zh...@rivai.ai Sent: Tuesday, July 4, 2023 9:10 PM To: gcc-patches@gcc.gnu.org Cc: richard.sandif...@arm.com; rguent...@suse.de; Ju-Zhe Zhong Subject: [PATCH V5] VECT: Ap

Re: [PATCH 2/2] x86: slightly correct / simplify *vec_extractv2ti

2023-07-05 Thread Hongtao Liu via Gcc-patches
On Wed, Jul 5, 2023 at 6:22 PM Hongtao Liu wrote: > > On Wed, Jul 5, 2023 at 5:03 PM Jan Beulich wrote: > > > > On 05.07.2023 10:47, Hongtao Liu wrote: > > > On Wed, Jul 5, 2023 at 4:01 PM Jan Beulich via Gcc-patches > > > wrote: > > >> > > >> V2TImode values cannot appear in the upper 16 YMM re

GTY: Repair 'enum gty_token', 'token_names' desynchronization (was: [cxx-conversion] Support garbage-collected C++ templates)

2023-07-05 Thread Thomas Schwinge
Hi! On 2012-08-10T11:06:46-0400, Diego Novillo wrote: > * gengtype-lex.l (USER_GTY): Add pattern for "user". > * gengtype-parse.c (option): Handle USER_GTY. > (opts_have): New. > (type): Call it. > If the keyword 'user' is used, do not walk the fields

Re: [PATCH 2/2] x86: slightly correct / simplify *vec_extractv2ti

2023-07-05 Thread Hongtao Liu via Gcc-patches
On Wed, Jul 5, 2023 at 5:03 PM Jan Beulich wrote: > > On 05.07.2023 10:47, Hongtao Liu wrote: > > On Wed, Jul 5, 2023 at 4:01 PM Jan Beulich via Gcc-patches > > wrote: > >> > >> V2TImode values cannot appear in the upper 16 YMM registers without > >> AVX512VL being enabled. Therefore forcing 512-

Re: [PATCH 1/2] x86: correct / simplify @vec_extract_hi_ and vec_extract_hi_v32qi

2023-07-05 Thread Hongtao Liu via Gcc-patches
On Wed, Jul 5, 2023 at 4:55 PM Jan Beulich wrote: > > On 05.07.2023 10:40, Hongtao Liu wrote: > > On Wed, Jul 5, 2023 at 4:00 PM Jan Beulich via Gcc-patches > > wrote: > >> > >> The middle alternative each was unusable without enabling AVX512DQ (in > >> addition to AVX512VL), which is entirely un

RE: [PATCH v4] RISC-V: Fix one bug for floating-point static frm

2023-07-05 Thread Li, Pan2 via Gcc-patches
Thanks Robin for reviewing, will address the comments with PATCH v5 later as I am in the middle of sth. > In riscv_mode_after the default mode is again FRM_MODE_NONE. Wouldn't > we also want FRM_MODE_DYN here? All of FRM should be aligned to DYN in PATCH v4, will double check about it when prep

[PATCH] RISC-V: Support variable index in vec_extract.

2023-07-05 Thread Robin Dapp via Gcc-patches
Hi, this patch adds a gen_lowpart in the vec_extract expander so it properly works with a variable index and adds tests. Regards Robin gcc/ChangeLog: * config/riscv/autovec.md: Add gen_lowpart. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vls-vlmax/vec_extract-1.c:

[PATCH] RISC-V: Allow variable index for vec_set.

2023-07-05 Thread Robin Dapp via Gcc-patches
Hi, this patch enables a variable index for vec_set and adjusts/cleans up the tests. Regards Robin gcc/ChangeLog: * config/riscv/autovec.md: Allow register index operand. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vls-vlmax/vec_set-1.c: Adjust test.

Re: [PATCH 2/2] x86: slightly correct / simplify *vec_extractv2ti

2023-07-05 Thread Jan Beulich via Gcc-patches
On 05.07.2023 10:47, Hongtao Liu wrote: > On Wed, Jul 5, 2023 at 4:01 PM Jan Beulich via Gcc-patches > wrote: >> >> V2TImode values cannot appear in the upper 16 YMM registers without >> AVX512VL being enabled. Therefore forcing 512-bit mode (also not >> reflected in the "mode" attribute) is point

Re: [PATCH 1/2] x86: correct / simplify @vec_extract_hi_ and vec_extract_hi_v32qi

2023-07-05 Thread Jan Beulich via Gcc-patches
On 05.07.2023 10:40, Hongtao Liu wrote: > On Wed, Jul 5, 2023 at 4:00 PM Jan Beulich via Gcc-patches > wrote: >> >> The middle alternative each was unusable without enabling AVX512DQ (in >> addition to AVX512VL), which is entirely unrelated here. The last >> alternative is usable with AVX512VL onl

[PATCH] Vect: select small VF for epilog of unrolled loop (PR tree-optimization/110474)

2023-07-05 Thread Hao Liu OS via Gcc-patches
Hi, If a loop is unrolled during vectorization (i.e. suggested_unroll_factor > 1), the VFs of both main and epilog loop are enlarged. The epilog vect loop is specific for a loop with small iteration counts, so a large VF may hurt performance. This patch unscales the main loop VF by suggested_unr

Re: [PATCH 2/2] x86: slightly correct / simplify *vec_extractv2ti

2023-07-05 Thread Hongtao Liu via Gcc-patches
On Wed, Jul 5, 2023 at 4:01 PM Jan Beulich via Gcc-patches wrote: > > V2TImode values cannot appear in the upper 16 YMM registers without > AVX512VL being enabled. Therefore forcing 512-bit mode (also not > reflected in the "mode" attribute) is pointless. Please set isa attribute for alternative 1

Re: [PATCH 1/2] x86: correct / simplify @vec_extract_hi_ and vec_extract_hi_v32qi

2023-07-05 Thread Hongtao Liu via Gcc-patches
On Wed, Jul 5, 2023 at 4:00 PM Jan Beulich via Gcc-patches wrote: > > The middle alternative each was unusable without enabling AVX512DQ (in > addition to AVX512VL), which is entirely unrelated here. The last > alternative is usable with AVX512VL only (due to type restrictions on > what may be put

Re: GTY: Enhance 'string_length' option documentation (was: 'unsigned int len' field in 'libcpp/include/symtab.h:struct ht_identifier' (was: [PATCH] pch: Fix streaming of strings with embedded null by

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 9:57 AM Thomas Schwinge wrote: > > Hi! > > On 2023-07-04T15:56:23-0400, Lewis Hyatt via Gcc-patches > wrote: > > On Tue, Jul 4, 2023 at 11:50 AM Thomas Schwinge > > wrote: > >> I came across this one here on my way working through another (somewhat > >> related) GTY issu

Re: GTY: Explicitly reject 'string_length' option for (fields in) global variables (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, Jul 5, 2023 at 9:51 AM Thomas Schwinge wrote: > > Hi! > > On 2022-10-18T18:14:54-0400, Lewis Hyatt via Gcc-patches > wrote: > > [...] add a new > > GTY option "string_length" so that gt_pch_note_object can be informed the > > actual length it ought to use, [...] > > > --- a/gcc/doc/gty.t

GTY: Clean up obsolete parametrized structs remnants (was: [PATCH 3/3] remove gengtype support for param_is use_param, if_marked and splay tree allocators)

2023-07-05 Thread Thomas Schwinge
Hi! On 2014-11-23T23:11:36-0500, tsaund...@mozilla.com wrote: > gcc/ > > * plugin.c, plugin.def, ggc.h, ggc-common.c, gengtype.h, gengtype.c, > gengtype-state.c, gengtype-parse.c, gentype-lex.l, gcc-plugin.h, > doc/plugins.texi, doc/gty.texi: Remove support for if_marked and >

Re: [PATCH] gimple-isel: Recognize vec_extract pattern.

2023-07-05 Thread Robin Dapp via Gcc-patches
>> + _4 = vD.2208; >> + _5 = .VEC_EXTRACT (_4, idx_2(D)); >> + _3 = _5; */ > > I think you are doing > > _3 = .VEC_EXTRACT (_4, idx_2(D)); > > and avoiding the SSA name copy correctly. Can you double-check? > > OK with the comment adjusted. Argh, yes, thanks. Regards

[PATCH] RISC-V: Handle rouding mode correctly on zfinx

2023-07-05 Thread Kito Cheng via Gcc-patches
Zfinx has provide fcsr like F, so rouding mode should use fcsr instead of `soft` fenv. libgcc/ChangeLog: * config/riscv/sfp-machine.h (FP_INIT_ROUNDMODE): Check zfinx. (FP_HANDLE_EXCEPTIONS): Ditto. --- libgcc/config/riscv/sfp-machine.h | 2 +- 1 file changed, 1 insertion(+), 1 d

GTY: Clean up obsolete 'bool needs_cast_p' field of 'gcc/gengtype.cc:struct walk_type_data' (was: [PATCH 3/3] remove gengtype support for param_is use_param, if_marked and splay tree allocators)

2023-07-05 Thread Thomas Schwinge
Hi! On 2014-11-23T23:11:36-0500, tsaund...@mozilla.com wrote: > gcc/ > > * plugin.c, plugin.def, ggc.h, ggc-common.c, gengtype.h, gengtype.c, > gengtype-state.c, gengtype-parse.c, gentype-lex.l, gcc-plugin.h, > doc/plugins.texi, doc/gty.texi: Remove support for if_marked and >

Re: [PATCH] gimple-isel: Recognize vec_extract pattern.

2023-07-05 Thread Richard Biener via Gcc-patches
On Tue, 4 Jul 2023, Robin Dapp wrote: > Hi Richard, > > changed the patch according to your comments and I agree that > it is more readable that way. I hope using lhs as target for > the extract directly is possible the way I did it. Richard's > patch for aarch64 is already, therefore testsuite

[PATCH] adjust testcase for now happening epilogue vectorization

2023-07-05 Thread Richard Biener via Gcc-patches
gcc.dg/vect/slp-perm-9.c is reported to FAIL with -march=cascadelake now which is because we now vectorize the epilogue with V2HImode vectors after the recent change to not scrap too large vector epilogues during transform but during analysis time. The following adjusts the testcase to always use

Re: [PATCH v4] RISC-V: Fix one bug for floating-point static frm

2023-07-05 Thread Robin Dapp via Gcc-patches
Hi Pan, yes, the problem is fixed for me. Still some comments ;) Sorry it took a while. > 1. By default, the RVV floating-point will take dyn mode. > 2. DYN is invalid in FRM register for RVV floating-point. > > When mode switching the function entry and exit, it will take DYN as > the frm mod

[PATCH 2/2] x86: slightly correct / simplify *vec_extractv2ti

2023-07-05 Thread Jan Beulich via Gcc-patches
V2TImode values cannot appear in the upper 16 YMM registers without AVX512VL being enabled. Therefore forcing 512-bit mode (also not reflected in the "mode" attribute) is pointless. gcc/ * config/i386/sse.md (*vec_extractv2ti): Drop g modifiers. --- a/gcc/config/i386/sse.md +++ b/gcc/con

[PATCH 1/2] x86: correct / simplify @vec_extract_hi_ and vec_extract_hi_v32qi

2023-07-05 Thread Jan Beulich via Gcc-patches
The middle alternative each was unusable without enabling AVX512DQ (in addition to AVX512VL), which is entirely unrelated here. The last alternative is usable with AVX512VL only (due to type restrictions on what may be put in the upper 16 YMM registers), and hence is pointlessly forcing 512-bit mod

[PATCH 0/2] x86: vec_extract_* adjustments

2023-07-05 Thread Jan Beulich via Gcc-patches
1: correct / simplify @vec_extract_hi_ and vec_extract_hi_v32qi 2: slightly correct / simplify *vec_extractv2ti Jan

GTY: Enhance 'string_length' option documentation (was: 'unsigned int len' field in 'libcpp/include/symtab.h:struct ht_identifier' (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)

2023-07-05 Thread Thomas Schwinge
Hi! On 2023-07-04T15:56:23-0400, Lewis Hyatt via Gcc-patches wrote: > On Tue, Jul 4, 2023 at 11:50 AM Thomas Schwinge > wrote: >> I came across this one here on my way working through another (somewhat >> related) GTY issue. I generally do understand the issue here, but do >> have a question

[PATCH] x86: suppress avx512f-copysign.c testcase for 32-bit

2023-07-05 Thread Jan Beulich via Gcc-patches
The test installed by "x86: make VPTERNLOG* usable on less than 512-bit operands with just AVX512F" won't succeed on 32-bit, for floating point operations being done there (by default) without using SIMD insns. gcc/testsuite/ * gcc.target/i386/avx512f-copysign.c: Suppress for 32-bit. --- C

GTY: Explicitly reject 'string_length' option for (fields in) global variables (was: [PATCH] pch: Fix streaming of strings with embedded null bytes)

2023-07-05 Thread Thomas Schwinge
Hi! On 2022-10-18T18:14:54-0400, Lewis Hyatt via Gcc-patches wrote: > [...] add a new > GTY option "string_length" so that gt_pch_note_object can be informed the > actual length it ought to use, [...] > --- a/gcc/doc/gty.texi > +++ b/gcc/doc/gty.texi > @@ -196,7 +196,26 @@ static GTY((length("r

Re: [PATCH] middle-end/110541 - VEC_PERM_EXPR documentation is off

2023-07-05 Thread Richard Biener via Gcc-patches
On Wed, 5 Jul 2023, Richard Sandiford wrote: > Richard Biener via Gcc-patches writes: > > The following adjusts the tree.def documentation about VEC_PERM_EXPR > > which wasn't adjusted when the restrictions of permutes with constant > > mask were relaxed. > > I was going to complain about having

Re: [PATCH] middle-end/110541 - VEC_PERM_EXPR documentation is off

2023-07-05 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > The following adjusts the tree.def documentation about VEC_PERM_EXPR > which wasn't adjusted when the restrictions of permutes with constant > mask were relaxed. I was going to complain about having two copies of the documentation, but then I realised that

Re: [PATCH v1] RISC-V: Use FRM_DYN when add the rounding mode operand

2023-07-05 Thread Kito Cheng via Gcc-patches
LGTM On Wed, Jul 5, 2023 at 10:08 AM juzhe.zh...@rivai.ai wrote: > > LGTM. > > > > juzhe.zh...@rivai.ai > > From: pan2.li > Date: 2023-07-04 20:26 > To: gcc-patches > CC: juzhe.zhong; rdapp.gcc; jeffreyalaw; pan2.li; yanzhang.wang; kito.cheng > Subject: [PATCH v1] RISC-V: Use FRM_DYN when add the

  1   2   >