[PATCH] i386: Auto vectorize usdot_prod, udot_prod with AVXVNNIINT16 instruction.

2023-07-13 Thread Haochen Jiang via Gcc-patches
Hi all, This patch aims to auto vectorize usdot_prod and udot_prod with newly introduced AVX-VNNI-INT16. Also I refined the redundant mode iterator in the patch. Regtested on x86_64-pc-linux-gnu. Ok for trunk after AVX-VNNI-INT16 patch checked in? BRs, Haochen gcc/ChangeLog: * config/

[PATCH] cprop: Do not set REG_EQUAL note when simplifying paradoxical subreg [PR110206]

2023-07-13 Thread Uros Bizjak via Gcc-patches
cprop1 pass does not consider paradoxical subreg and for (insn 22) claims that it equals 8 elements of HImodeby setting REG_EQUAL note: (insn 21 19 22 4 (set (reg:V4QI 98) (mem/u/c:V4QI (symbol_ref/u:DI ("*.LC1") [flags 0x2]) [0 S4 A32])) "pr110206.c":12:42 1530 {*movv4qi_internal} (

[PATCH] Implement Bit-field lowering

2023-07-13 Thread naveenh--- via Gcc-patches
From: Naveen H S This patch adds lowering bit-field and opposite endian accesses pass. The patch addresses many issues in:- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19466 2023-07-14 Andrew Pinski Co-authored-by: Naveen H S gcc/ChangeLog: * Makefile.in (OBJS): Add gimple-lower-

Re: [PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.

2023-07-13 Thread Jeff Law via Gcc-patches
On 7/13/23 09:05, Manolis Tsamis wrote: In this version I have made f-m-o able to also eliminate constant moves in addition to the add constant instructions. This increases the number of simplified/eliminated instructions and is a good addition for RISC style ISAs where these are more common.

[PATCH] Initial Lunar Lake, Arrow Lake and Arrow Lake S Support

2023-07-13 Thread Mo, Zewei via Gcc-patches
Hi all, This patch is to add initial support for Lunar Lake, Arrow Lake and Arrow Lake S for GCC. This 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 This has been test

Re: [PATCH] RISC-V: Remove the redundant expressions in the and3.

2023-07-13 Thread Jeff Law via Gcc-patches
On 7/13/23 20:41, Kito Cheng via Gcc-patches wrote: Expanding without DONE or FAIL will leave the pattern as well, so this patch is fine IMO, so this patch LGTM, but anyway I will test this and commit if passed :) THanks. I looked fine to me, but I wasn't going to have the time to commit/pus

Re: [PATCH] RISC-V: Remove the redundant expressions in the and3.

2023-07-13 Thread Jeff Law via Gcc-patches
On 7/13/23 20:44, Palmer Dabbelt wrote: On Thu, 13 Jul 2023 19:41:08 PDT (-0700), gcc-patches@gcc.gnu.org wrote: Expanding without DONE or FAIL will leave the pattern as well, so this patch is fine IMO, so this patch LGTM, but anyway I will test this and commit if passed :) Ah, thanks, I gu

[PATCH v1] RISC-V: Support basic floating-point dynamic rounding mode

2023-07-13 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the basic floating-point dynamic rounding modes for the RVV. We implement the dynamic rounding mode by below steps. 1. Set entry to DYN and exit to DYN_EXIT. 2. Add one rtl variable into machine_function for backup/restore. 3. Backup frm value when e

RE: [x86 PATCH] Fix FAIL of gcc.target/i386/pr91681-1.c

2023-07-13 Thread Jiang, Haochen via Gcc-patches
> The recent change in TImode parameter passing on x86_64 results in the FAIL > of pr91681-1.c. The issue is that with the extra flexibility, the combine > pass is > now spoilt for choice between using either the > *add3_doubleword_concat or the *add3_doubleword_zext > patterns, when one operand

Re: [PATCH] RISC-V: Remove the redundant expressions in the and3.

2023-07-13 Thread Palmer Dabbelt
On Thu, 13 Jul 2023 19:41:08 PDT (-0700), gcc-patches@gcc.gnu.org wrote: Expanding without DONE or FAIL will leave the pattern as well, so this patch is fine IMO, so this patch LGTM, but anyway I will test this and commit if passed :) Ah, thanks, I guess I didn't know that. This is probably fi

Re: [PATCH] RISC-V: Remove the redundant expressions in the and3.

2023-07-13 Thread Kito Cheng via Gcc-patches
Expanding without DONE or FAIL will leave the pattern as well, so this patch is fine IMO, so this patch LGTM, but anyway I will test this and commit if passed :) On Fri, Jul 14, 2023 at 10:34 AM Palmer Dabbelt wrote: > > On Thu, 13 Jul 2023 19:02:05 PDT (-0700), li...@eswincomputing.com wrote: >

Re: [PATCH] RISC-V: Remove the redundant expressions in the and3.

2023-07-13 Thread Palmer Dabbelt
On Thu, 13 Jul 2023 19:02:05 PDT (-0700), li...@eswincomputing.com wrote: When generating the gen_and3 function based on the and3 template, it produces the expression emit_insn (gen_rtx_SET (operand0, gen_rtx_AND (, operand1, operand2)));, which is identical to the portion I removed in this patch

[r14-2462 Regression] FAIL: libgomp.c++/../libgomp.c-c++-common/alloc-12.c execution test on Linux/x86_64

2023-07-13 Thread Jiang, Haochen via Gcc-patches
On Linux/x86_64, 450b05ce54d3f08c583c3b5341233ce0df99725b is the first bad commit commit 450b05ce54d3f08c583c3b5341233ce0df99725b Author: Tobias Burnus Date: Wed Jul 12 13:50:21 2023 +0200 libgomp: Use libnuma for OpenMP's partition=nearest allocation trait caused with GCC configured w

[SH][committed] Fix PR 101469

2023-07-13 Thread Oleg Endo
Hi, The attached patch fixes PR 101469. Tested by the original reporter Rin Okuyama on NetBSD with GCC 10.5. Applied to master, GCC 11, GCC 12, GCC 13 after 'make all' sanity check. Cheers, Oleg gcc/ChangeLog: PR target/101469 * config/sh/sh.md (peephole2): Handle case where el

[PATCH] RISC-V: Remove the redundant expressions in the and3.

2023-07-13 Thread Die Li
When generating the gen_and3 function based on the and3 template, it produces the expression emit_insn (gen_rtx_SET (operand0, gen_rtx_AND (, operand1, operand2)));, which is identical to the portion I removed in this patch. Therefore, the redundant portion can be deleted. Signed-off-by: Die Li

Re: Re: [PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread 钟居哲
Ok. Comments added: in V2: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624476.html juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-07-13 23:25 To: juzhe.zhong; Kito Cheng CC: rdapp.gcc; gcc-patches; jeffreyalaw; kito.cheng; palmer; palmer Subject: Re: [PATCH] RISC-V: Enable COND_LEN

[PATCH V2] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread Juzhe-Zhong
Add comments as Robin's suggestion in scatter_store_run-7.c Enable COND_LEN_FMA auto-vectorization for floating-point FMA auto-vectorization **NO** ffast-math. Since the middle-end support has been approved and I will merge it after I finished bootstrap && regression on X86. https://gcc.gnu.org

[PATCH v6 2/2] libstdc++: Use new built-in trait __is_pointer

2023-07-13 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_pointer. libstdc++-v3/ChangeLog: * include/bits/cpp_type_traits.h (__is_ptr): Use __is_pointer built-in trait. * include/std/type_traits (is_pointer): Likewise. Optimize its implementation. (is_pointer_v

[PATCH v6 1/2] c++, libstdc++: Implement __is_pointer built-in trait

2023-07-13 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuit

Re: [PATCH] c++: redundant targ coercion for var/alias tmpls

2023-07-13 Thread Jason Merrill via Gcc-patches
On 7/13/23 11:48, Patrick Palka wrote: On Wed, 28 Jun 2023, Patrick Palka wrote: On Wed, Jun 28, 2023 at 11:50 AM Jason Merrill wrote: On 6/23/23 12:23, Patrick Palka wrote: On Fri, 23 Jun 2023, Jason Merrill wrote: On 6/21/23 13:19, Patrick Palka wrote: When stepping through the variabl

Re: [V1][PATCH 0/3] New attribute "element_count" to annotate bounds for C99 FAM(PR108896)

2023-07-13 Thread Kees Cook via Gcc-patches
On Thu, Jul 06, 2023 at 06:56:21PM +, Qing Zhao wrote: > Hi, Kees, > > I have updated my V1 patch with the following changes: > A. changed the name to "counted_by" > B. changed the argument from a string to an identifier > C. updated the documentation and testing cases accordingly. Sounds gre

Re: [PATCH V4, rs6000] Disable generation of scalar modulo instructions

2023-07-13 Thread Pat Haugen via Gcc-patches
Ping. On 6/30/23 2:26 PM, Pat Haugen via Gcc-patches wrote: Updated from prior version to address latest review comment (simplify umod3). Disable generation of scalar modulo instructions. It was recently discovered that the scalar modulo instructions can suffer noticeable performance issues fo

Re: [PATCH] fix pdp11_expand_epilogue (PR target/107841)

2023-07-13 Thread Paul Koning via Gcc-patches
> On Jul 13, 2023, at 12:47 PM, Mikael Pettersson wrote: > > If the stack frame only contains an alloca area, then > pdp11_expand_epilogue fails to deallocate it, resulting > in callee-saved registers and the return address being > restored from the wrong stack slots. Fixed by adding > || cfu

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-13 Thread Ken Matsui via Gcc-patches
On Thu, Jul 13, 2023 at 2:22 AM Jonathan Wakely wrote: > > On Wed, 12 Jul 2023 at 21:42, Ken Matsui wrote: > > > > On Wed, Jul 12, 2023 at 3:01 AM Jonathan Wakely wrote: > > > > > > On Mon, 10 Jul 2023 at 06:51, Ken Matsui via Libstdc++ > > > wrote: > > > > > > > > Hi, > > > > > > > > Here is t

Re: [PATCH 0/3] Fix argument evaluation order [PR92178]

2023-07-13 Thread Harald Anlauf via Gcc-patches
Hi Mikael, Am 11.07.23 um 12:32 schrieb Mikael Morin via Gcc-patches: Hello, this is a followup to Harald's recent work [1] on the evaluation order of arguments, when one of them is passed to an intent(out) allocatable dummy and is deallocated before the call. This extends Harald's fix to suppo

[pushed] Darwin: Use -platform_version when available [PR110624].

2023-07-13 Thread Iain Sandoe via Gcc-patches
tested on i688, x86_64 Darwin versions with/without support for the platform_version flag. Checked by Rainer on macOS14. Pushed to trunk thanks, Iain --- 8< --- Later versions of the static linker support a more flexible flag to describe the OS, OS version and SDK used to build the code. This r

RE: [PATCH 12/19]middle-end: implement loop peeling and IV updates for early break.

2023-07-13 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Thursday, July 13, 2023 6:31 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; j...@ventanamicro.com > Subject: Re: [PATCH 12/19]middle-end: implement loop peeling and IV > updates for early break. > > On Wed, 28 Jun 2023, Ta

[PATCH v2] c++: wrong error with static constexpr var in tmpl [PR109876]

2023-07-13 Thread Marek Polacek via Gcc-patches
On Fri, May 26, 2023 at 09:47:10PM -0400, Jason Merrill wrote: > On 5/26/23 19:18, Marek Polacek wrote: > > Since r8-509, we'll no longer create a static temporary var for > > the initializer '{ 1, 2 }' for num in the attached test because > > the code in finish_compound_literal is now guarded by >

Re: [PATCH] fix pdp11_expand_epilogue (PR target/107841)

2023-07-13 Thread Jeff Law via Gcc-patches
On 7/13/23 11:46, Paul Koning via Gcc-patches wrote: On Jul 13, 2023, at 12:47 PM, Mikael Pettersson wrote: If the stack frame only contains an alloca area, then pdp11_expand_epilogue fails to deallocate it, resulting in callee-saved registers and the return address being restored from th

[PATCH] c++: copy elision of object arg in static memfn call [PR110441]

2023-07-13 Thread Patrick Palka via Gcc-patches
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here the call A().f() is represented as a COMPOUND_EXPR whose first operand is the otherwise unused object argument A() and second operand is the call result (both are TARGET_EXPRs). Within the return statem

Re: [x86 PATCH] PR target/110588: Add *bt_setncqi_2 to generate btl

2023-07-13 Thread Uros Bizjak via Gcc-patches
On Thu, Jul 13, 2023 at 7:10 PM Roger Sayle wrote: > > > This patch resolves PR target/110588 to catch another case in combine > where the i386 backend should be generating a btl instruction. This adds > another define_insn_and_split to recognize the RTL representation for this > case. > > I also

Re: [PATCH] m2, build: Use LDLFAGS for mklink

2023-07-13 Thread Gaius Mulley via Gcc-patches
Rainer Orth writes: > When trying to bootstrap current trunk on macOS 14.0 beta 3 with Xcode > 15 beta 4, the build failed running mklink in stage 2: > > unset CC ; m2/boot-bin/mklink -s --langc++ --exit --name m2/mc-boot/main.cc > /vol/gcc/src/hg/master/darwin/gcc/m2/init/mcinit > dyld[55825]:

Re: [PATCH] fix pdp11_expand_epilogue (PR target/107841)

2023-07-13 Thread Paul Koning via Gcc-patches
> On Jul 13, 2023, at 12:47 PM, Mikael Pettersson wrote: > > If the stack frame only contains an alloca area, then > pdp11_expand_epilogue fails to deallocate it, resulting > in callee-saved registers and the return address being > restored from the wrong stack slots. Fixed by adding > || cfu

Re: [PATCH 12/19]middle-end: implement loop peeling and IV updates for early break.

2023-07-13 Thread Richard Biener via Gcc-patches
On Wed, 28 Jun 2023, Tamar Christina wrote: > Hi All, > > This patch updates the peeling code to maintain LCSSA during peeling. > The rewrite also naturally takes into account multiple exits and so it didn't > make sense to split them off. > > For the purposes of peeling the only change for mult

[x86 PATCH] PR target/110588: Add *bt_setncqi_2 to generate btl

2023-07-13 Thread Roger Sayle
This patch resolves PR target/110588 to catch another case in combine where the i386 backend should be generating a btl instruction. This adds another define_insn_and_split to recognize the RTL representation for this case. I also noticed that two related define_insn_and_split weren't using the

[committed] libstdc++: std::stoi etc. do not need C99 support [PR110653]

2023-07-13 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- std::stoi, std::stol, std::stoul, and std::stod only depend on C89 functions, so don't need to be guarded by _GLIBCXX_USE_C99_STDLIB std::stoll and std::stoull don't need C99 strtoll and strtoull if sizeof(long) == sizeof(long long). std::stol

Re: [PATCH v2] Implement new RTL optimizations pass: fold-mem-offsets.

2023-07-13 Thread Jeff Law via Gcc-patches
On 7/13/23 08:20, Manolis Tsamis wrote: I have sent a V3 which contains a number of fixes and improvements: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624439.html I tested the new version rebased on master and the m68k issue did not reproduce. I don't know what exactly fixed it; do

[PATCH] fix pdp11_expand_epilogue (PR target/107841)

2023-07-13 Thread Mikael Pettersson via Gcc-patches
If the stack frame only contains an alloca area, then pdp11_expand_epilogue fails to deallocate it, resulting in callee-saved registers and the return address being restored from the wrong stack slots. Fixed by adding || cfun->calls_alloca to the condition for deallocating the frame. Tested with

[x86_64 PATCH] Improved insv of DImode/DFmode {high, low}parts into TImode.

2023-07-13 Thread Roger Sayle
This is the next piece towards a fix for (the x86_64 ABI issues affecting) PR 88873. This patch generalizes the recent tweak to ix86_expand_move for setting the highpart of a TImode reg from a DImode source using *insvti_highpart_1, to handle both DImode and DFmode sources, and also use the recen

[committed] alpha: Fix computation mode in alpha_emit_set_long_cost [PR106966]

2023-07-13 Thread Uros Bizjak via Gcc-patches
PR target/106966 gcc/ChangeLog: * config/alpha/alpha.cc (alpha_emit_set_long_const): Always use DImode when constructing long const. gcc/testsuite/ChangeLog: * gcc.target/alpha/pr106966.c: New test. Bootstrapped and regression tested by Matthias on alpha-linux-gnu. Uros. diff

RE: [PATCH 9/19] middle-end: refactor vectorizable_comparison to make the main body re-usable.

2023-07-13 Thread Richard Biener via Gcc-patches
On Wed, 28 Jun 2023, Tamar Christina wrote: > Adding proper maintainers. > > > -Original Message- > > From: Tamar Christina > > Sent: Wednesday, June 28, 2023 2:46 PM > > To: gcc-patches@gcc.gnu.org > > Cc: nd ; Richard Earnshaw ; > > Marcus Shawcroft ; Kyrylo Tkachov > > ; Richard Sandi

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: libgomp.c+

Re: [PATCH] c++: redundant targ coercion for var/alias tmpls

2023-07-13 Thread Patrick Palka via Gcc-patches
On Wed, 28 Jun 2023, Patrick Palka wrote: > On Wed, Jun 28, 2023 at 11:50 AM Jason Merrill wrote: > > > > On 6/23/23 12:23, Patrick Palka wrote: > > > On Fri, 23 Jun 2023, Jason Merrill wrote: > > > > > >> On 6/21/23 13:19, Patrick Palka wrote: > > >>> When stepping through the variable/alias tem

Re: [PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread Robin Dapp via Gcc-patches
> Is COND _LEN FMA ok for trunk? I can commit it without changing > scatter store testcase fix. > > It makes no sense block cond Len fma support. The middle end support > has already been merged. Then just add a TODO or so that says e.g. "For some reason we exceed the default code model's +-2

Re: [PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.

2023-07-13 Thread Manolis Tsamis
In this version I have made f-m-o able to also eliminate constant moves in addition to the add constant instructions. This increases the number of simplified/eliminated instructions and is a good addition for RISC style ISAs where these are more common. This has led to pr52146.c failing in x86, wh

[pushed][RA][PR109520]: Catch error when there are no enough registers for asm insn

2023-07-13 Thread Vladimir Makarov via Gcc-patches
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109520 The patch was successfully bootstrapped and tested on x86-64, aarch64, and ppc64le. commit b175b4887f928118af997f6d4d75097a64dcec5d Author: Vladimir N. Makarov Date: Thu Jul 13 10:42:17 2023 -0400 [RA][PR10

Re: Re: [PATCH V7] RISC-V: RISC-V: Support gather_load/scatter RVV auto-vectorization

2023-07-13 Thread 钟居哲
No, I am just want to whether we have some CALL vectorization need len or mask predication. For example, Current GCC vectorization CALL onyl FMAX/FMIN/FMA/FNMA/FMS/FNMS these CALL function need length or mask predicate. I don't care about sin/cos/popcount...etc. We just use full vector autovec

Re: Re: [PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread 钟居哲
Yes. Not always fail. juzhe.zh...@rivai.ai From: Kito Cheng Date: 2023-07-13 22:39 To: juzhe.zh...@rivai.ai CC: Robin Dapp; gcc-patches; jeffreyalaw; kito.cheng; palmer; palmer Subject: Re: Re: [PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization I didn’t try on local yet, but it sounds like

Re: Re: [PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread Kito Cheng via Gcc-patches
I didn’t try on local yet, but it sounds like …the code size might larger than normal case? juzhe.zh...@rivai.ai 於 2023年7月13日 週四,19:50寫道: > Could you tell me how to add the comment? > I am not familiar with link/binutils stuff. > > -- > juzhe.zh...@rivai.ai > > > *From

Re: [PATCH V7] RISC-V: RISC-V: Support gather_load/scatter RVV auto-vectorization

2023-07-13 Thread Robin Dapp via Gcc-patches
From my understanding, we dont have RVV instruction for fmax/fmin? > > Unless I'm misunderstanding, we do. The ISA manual says > > === Vector Floating-Point MIN/MAX Instructions > > The vector floating-point `vfmin` and `vfmax` instructions have the > same behavior as the

Re: [PATCH v2] Implement new RTL optimizations pass: fold-mem-offsets.

2023-07-13 Thread Manolis Tsamis
On Wed, Jul 12, 2023 at 5:14 PM Jeff Law wrote: > > > > On 7/12/23 03:12, Manolis Tsamis wrote: > > On Mon, Jul 10, 2023 at 12:58 AM Hans-Peter Nilsson > > wrote: > >> > >> On Sun, 9 Jul 2023, Hans-Peter Nilsson wrote: > >> > >>> On Thu, 15 Jun 2023, Manolis Tsamis wrote: > >>> > This is a

RE: [PATCH V2] SSA MATH: Support COND_LEN_FMA for floating-point math optimization

2023-07-13 Thread Li, Pan2 via Gcc-patches
Committed, thanks Richard. Pan -Original Message- From: Gcc-patches On Behalf Of Richard Biener via Gcc-patches Sent: Thursday, July 13, 2023 6:51 PM To: Ju-Zhe Zhong Cc: gcc-patches@gcc.gnu.org; richard.sandif...@arm.com Subject: Re: [PATCH V2] SSA MATH: Support COND_LEN_FMA for float

[PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.

2023-07-13 Thread Manolis Tsamis
This is a new RTL pass that tries to optimize memory offset calculations by moving them from add immediate instructions to the memory loads/stores. For example it can transform this: addi t4,sp,16 add t2,a6,t4 shl t3,t2,1 ld a2,0(t3) addi a2,1 sd a2,8(t2) into the following (one

Re: [PATCH 2/2] ifcvt: Allow more operations in multiple set if conversion

2023-07-13 Thread Manolis Tsamis
I resent this with just the change in the comment. OK to merge? Manolis On Tue, Jul 4, 2023 at 5:32 PM Manolis Tsamis wrote: > > On Mon, Jul 3, 2023 at 12:12 PM Robin Dapp wrote: > > > > Hi Manolis, > > > > that looks like a nice enhancement of what's already possible. The concern > > I had so

[PATCH v2 2/2] ifcvt: Allow more operations in multiple set if conversion

2023-07-13 Thread Manolis Tsamis
Currently the operations allowed for if conversion of a basic block with multiple sets are few, namely REG, SUBREG and CONST_INT (as controlled by bb_ok_for_noce_convert_multiple_sets). This commit allows more operations (arithmetic, compare, etc) to participate in if conversion. The target's prof

[PATCH v2 1/2] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2023-07-13 Thread Manolis Tsamis
This is an extension of what was done in PR106590. Currently if a sequence generated in noce_convert_multiple_sets clobbers the condition rtx (cc_cmp or rev_cc_cmp) then only seq1 is used afterwards (sequences that emit the comparison itself). Since this applies only from the next iteration it ass

[PATCH v2 0/2] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets

2023-07-13 Thread Manolis Tsamis
noce_convert_multiple_sets has been introduced and extended over time to handle if conversion for blocks with multiple sets. Currently this is focused on register moves and rejects any sort of arithmetic operations. This series is an extension to allow more sequences to take part in if conversio

Re: [PATCH V7] RISC-V: RISC-V: Support gather_load/scatter RVV auto-vectorization

2023-07-13 Thread Palmer Dabbelt
On Thu, 13 Jul 2023 07:01:26 PDT (-0700), gcc-patches@gcc.gnu.org wrote: > > > On 7/13/23 01:47, Richard Biener wrote: >> On Thu, Jul 13, 2023 at 1:30 AM 钟居哲 wrote: >>> >>> I notice vectorizable_call in Loop Vectorizer. >>> It's vectorizing CALL function for example like fmax/fmin. >>> Fr

Re: [PATCH V7] RISC-V: RISC-V: Support gather_load/scatter RVV auto-vectorization

2023-07-13 Thread Jeff Law via Gcc-patches
On 7/13/23 01:47, Richard Biener wrote: On Thu, Jul 13, 2023 at 1:30 AM 钟居哲 wrote: I notice vectorizable_call in Loop Vectorizer. It's vectorizing CALL function for example like fmax/fmin. From my understanding, we dont have RVV instruction for fmax/fmin? There's things like .POPCOUNT wh

Re: [PATCH V7] RISC-V: RISC-V: Support gather_load/scatter RVV auto-vectorization

2023-07-13 Thread Jeff Law via Gcc-patches
On 7/12/23 17:30, 钟居哲 wrote: I notice vectorizable_call in Loop Vectorizer. It's vectorizing CALL function for example like fmax/fmin. From my understanding, we dont have RVV instruction for fmax/fmin? So for now, I don't need to support builtin call function vectorization for RVV. Am I ri

Re: [RFC] light expander sra for parameters and returns

2023-07-13 Thread Jiufu Guo via Gcc-patches
Hi Martin, Jiufu Guo via Gcc-patches writes: > Hi, > > Martin Jambor writes: > >> Hi, >> >> On Tue, May 30 2023, Richard Biener wrote: >>> On Mon, 29 May 2023, Jiufu Guo wrote: >>> Hi, Previously, I was investigating some struct parameters and returns related PRs 69143/65

[PATCH] c++: mangling template-id of unknown template [PR110524]

2023-07-13 Thread Patrick Palka via Gcc-patches
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 13? -- >8 -- This fixes a crash when mangling an ADL-enabled call to a template-id naming an unknown template (as per P0846R0). PR c++/110524 gcc/cp/ChangeLog: * mangle.cc (write_expressi

Re: [IRA] Skip empty register classes in setup_reg_class_relations

2023-07-13 Thread Vladimir Makarov via Gcc-patches
On 7/12/23 07:05, senthilkumar.selva...@microchip.com wrote: Hi, I've been spending some (spare) time trying to get LRA working for the avr target. Thank you for addressing this problem. The code you changing is very sensitive and was a source of multiple PRs in the past.  But I foun

Re: [PATCH] vect: Handle demoting FLOAT and promoting FIX_TRUNC.

2023-07-13 Thread Richard Biener via Gcc-patches
On Thu, Jul 13, 2023 at 2:19 PM Robin Dapp wrote: > > > Can you add testcases? Also the current restriction is because > > the variants you add are not always correct and I don't see any > > checks that the intermediate type doesn't lose significant bits? > > The testcases I wanted to add with a

Re: [PATCH] vect: Handle demoting FLOAT and promoting FIX_TRUNC.

2023-07-13 Thread Robin Dapp via Gcc-patches
> Can you add testcases? Also the current restriction is because > the variants you add are not always correct and I don't see any > checks that the intermediate type doesn't lose significant bits? The testcases I wanted to add with a follow-up RISC-V patch but I can also try an aarch64 one. So

RE: [PATCH 7/19]middle-end: Refactor vectorizer loop conditionals and separate out IV to new variables

2023-07-13 Thread Richard Biener via Gcc-patches
On Thu, 13 Jul 2023, Tamar Christina wrote: > > e7ac2b5f3db55de3dbbab7bd2bfe08388f4ec533..cab82d7960e5be517bba2 > > 621f7f4 > > > 888e7bf3c295 100644 > > > --- a/gcc/cfgloop.h > > > +++ b/gcc/cfgloop.h > > > @@ -272,6 +272,14 @@ public: > > > the basic-block from being collected but its inde

RE: [PATCH 8/19]middle-end: updated niters analysis to handle multiple exits.

2023-07-13 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Biener > Sent: Thursday, July 13, 2023 12:49 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; j...@ventanamicro.com > Subject: Re: [PATCH 8/19]middle-end: updated niters analysis to handle > multiple exits. > > On Wed, 28 Jun 2023, Tamar C

RE: [PATCH 7/19]middle-end: Refactor vectorizer loop conditionals and separate out IV to new variables

2023-07-13 Thread Tamar Christina via Gcc-patches
> e7ac2b5f3db55de3dbbab7bd2bfe08388f4ec533..cab82d7960e5be517bba2 > 621f7f4 > > 888e7bf3c295 100644 > > --- a/gcc/cfgloop.h > > +++ b/gcc/cfgloop.h > > @@ -272,6 +272,14 @@ public: > > the basic-block from being collected but its index can still be > > reused. */ > >basic_block for

Re: Re: [PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread juzhe.zh...@rivai.ai
Could you tell me how to add the comment? I am not familiar with link/binutils stuff. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-07-13 19:40 To: Juzhe-Zhong; gcc-patches CC: rdapp.gcc; kito.cheng; kito.cheng; palmer; palmer; jeffreyalaw Subject: Re: [PATCH] RISC-V: Enable COND_LEN_FMA au

Re: [PATCH 8/19]middle-end: updated niters analysis to handle multiple exits.

2023-07-13 Thread Richard Biener via Gcc-patches
On Wed, 28 Jun 2023, Tamar Christina wrote: > Hi All, > > For early break vectorization we have to update niters analysis to record and > analyze all exits of the loop, and so all conds. > > The niters of the loop is still determined by the main/natural exit of the > loop > as this is the O(n)

Re: Re: [PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread juzhe.zh...@rivai.ai
I have no ideal. This testcase cause link ICE: FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/scatter_store_run-7.c (test for excess errors) Excess errors: scatter_store_run-7.c:(.text.startup+0xc8e): relocation truncated to fit: R_RISCV_GPREL_I against `.LANCHOR1' only LMUL = M8 will cause

Re: [PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread Robin Dapp via Gcc-patches
Hi Juzhe, thanks, no complaints from my side apart from one: > +/* { dg-additional-options "-mcmodel=medany" } */ Please add a comment why we need this. Regards Robin

[PATCH] RISC-V: Enable COND_LEN_FMA auto-vectorization

2023-07-13 Thread Juzhe-Zhong
Enable COND_LEN_FMA auto-vectorization for floating-point FMA auto-vectorization **NO** ffast-math. Since the middle-end support has been approved and I will merge it after I finished bootstrap && regression on X86. https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624395.html Now, it's time

Re: [PATCH 7/19]middle-end: Refactor vectorizer loop conditionals and separate out IV to new variables

2023-07-13 Thread Richard Biener via Gcc-patches
On Wed, 28 Jun 2023, Tamar Christina wrote: > Hi All, > > This patch splits off the vectorizer's understanding of the main loop exit off > from the normal loop infrastructure. > > Essentially we're relaxing the use of single_exit() in the vectorizer as we > will > no longer have a single single

[PATCH, OpenACC 2.7, v2] Implement host_data must have use_device clause requirement

2023-07-13 Thread Chung-Lin Tang via Gcc-patches
On 2023/6/16 5:13 PM, Thomas Schwinge wrote: > OK with one small change, please -- unless there's a reason for doing it > this way: > >> --- a/gcc/fortran/trans-openmp.cc >> +++ b/gcc/fortran/trans-openmp.cc >> @@ -4677,6 +4677,12 @@ gfc_trans_oacc_construct (gfc_code *code) >> break; >>

Re: [PATCH V2] SSA MATH: Support COND_LEN_FMA for floating-point math optimization

2023-07-13 Thread Richard Biener via Gcc-patches
On Thu, 13 Jul 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Hi, Richard and Richi. > > Previous patch we support COND_LEN_* binary operations. However, we didn't > support COND_LEN_* ternary. > > Now, this patch support COND_LEN_* ternary. Consider this following case: > > #defi

Re: [PATCH] vect: Handle demoting FLOAT and promoting FIX_TRUNC.

2023-07-13 Thread Richard Biener via Gcc-patches
On Thu, Jul 13, 2023 at 12:31 PM Robin Dapp via Gcc-patches wrote: > > Hi, > > the recent changes that allowed multi-step conversions for > "non-packing/unpacking", i.e. modifier == NONE targets included > promoting to-float and demoting to-int variants. This patch > adds demoting to-float and pr

RE: [PATCH v2] RISC-V: Refactor riscv mode after for VXRM and FRM

2023-07-13 Thread Li, Pan2 via Gcc-patches
Sure and committed, thanks Kito. Pan -Original Message- From: Kito Cheng Sent: Thursday, July 13, 2023 5:19 PM To: Li, Pan2 Cc: Jeff Law ; gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; rdapp@gmail.com; Wang, Yanzhang Subject: Re: [PATCH v2] RISC-V: Refactor riscv mode after for

Re: [RFC] GNU Vector Extension -- Packed Boolean Vectors

2023-07-13 Thread Richard Biener via Gcc-patches
On Thu, Jul 13, 2023 at 12:15 PM Tejas Belagod wrote: > > On 7/3/23 1:31 PM, Richard Biener wrote: > > On Mon, Jul 3, 2023 at 8:50 AM Tejas Belagod wrote: > >> > >> On 6/29/23 6:55 PM, Richard Biener wrote: > >>> On Wed, Jun 28, 2023 at 1:26 PM Tejas Belagod > >>> wrote: > > > >

[PATCH] vect: Handle demoting FLOAT and promoting FIX_TRUNC.

2023-07-13 Thread Robin Dapp via Gcc-patches
Hi, the recent changes that allowed multi-step conversions for "non-packing/unpacking", i.e. modifier == NONE targets included promoting to-float and demoting to-int variants. This patch adds demoting to-float and promoting to-int handling. Bootstrapped and regtested on x86 and aarch64. A quest

[PATCH 2/6] arm: [MVE intrinsics] rework vcaddq vhcaddq

2023-07-13 Thread Christophe Lyon via Gcc-patches
Implement vcaddq, vhcaddq using the new MVE builtins framework. 2023-07-13 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-base.cc (vcaddq_rot90) (vcaddq_rot270, vhcaddq_rot90, vhcaddq_rot270): New. * config/arm/arm-mve-builtins-base.def (vcaddq_rot90)

[PATCH 4/6] arm: [MVE intrinsics] rework vcmulq

2023-07-13 Thread Christophe Lyon via Gcc-patches
Implement vcmulq using the new MVE builtins framework. 2023-07-13 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-base.cc (vcmulq, vcmulq_rot90) (vcmulq_rot180, vcmulq_rot270): New. * config/arm/arm-mve-builtins-base.def (vcmulq, vcmulq_rot90) (vcmulq_

[PATCH 5/6] arm: [MVE intrinsics] factorize vcmlaq

2023-07-13 Thread Christophe Lyon via Gcc-patches
Factorize vcmlaq builtins so that they use parameterized names. 2023-17-13 Christophe Lyon gcc/ * config/arm/arm_mve_builtins.def (vcmlaq_rot90_f) (vcmlaq_rot270_f, vcmlaq_rot180_f, vcmlaq_f): Add "_f" suffix. * config/arm/iterators.md (MVE_VCMLAQ_M): New.

[PATCH 3/6] arm: [MVE intrinsics factorize vcmulq

2023-07-13 Thread Christophe Lyon via Gcc-patches
Factorize vcmulq builtins so that they use parameterized names. We can merged them with vcadd. 2023-07-13 Christophe Lyon gcc/: * config/arm/arm_mve_builtins.def (vcmulq_rot90_f) (vcmulq_rot270_f, vcmulq_rot180_f, vcmulq_f): Add "_f" suffix. * config/arm/iterat

[PATCH 1/6] arm: [MVE intrinsics] Factorize vcaddq vhcaddq

2023-07-13 Thread Christophe Lyon via Gcc-patches
Factorize vcaddq, vhcaddq so that they use the same parameterized names. To be able to use the same patterns, we add a suffix to vcaddq. Note that vcadd uses UNSPEC_VCADDxx for builtins without predication, and VCADDQ_ROTxx_M_x (that is, not starting with "UNSPEC_"). The UNPEC_* names are also u

[PATCH 6/6] arm: [MVE intrinsics] rework vcmlaq

2023-07-13 Thread Christophe Lyon via Gcc-patches
Implement vcmlaq using the new MVE builtins framework. 2023-07-13 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-base.cc (vcmlaq, vcmlaq_rot90) (vcmlaq_rot180, vcmlaq_rot270): New. * config/arm/arm-mve-builtins-base.def (vcmlaq, vcmlaq_rot90) (vcmlaq

[PATCH 2/2] [testsuite, arm]: Make mve_fp_fpu[12].c accept single or double precision FPU

2023-07-13 Thread Christophe Lyon via Gcc-patches
This tests currently expect a directive containing .fpu fpv5-sp-d16 and thus may fail if the test is executed for instance with -march=armv8.1-m.main+mve.fp+fp.dp This patch accepts either fpv5-sp-d16 or fpv5-d16 to avoid the failure. 2023-06-28 Christophe Lyon gcc/testsuite/

[PATCH 1/2] [testsuite,arm]: Make nomve_fp_1.c require arm_fp

2023-07-13 Thread Christophe Lyon via Gcc-patches
If GCC is configured with the default (soft) -mfloat-abi, and we don't override the target_board test flags appropriately, gcc.target/arm/mve/general-c/nomve_fp_1.c fails for lack of -mfloat-abi=softfp or -mfloat-abi=hard, because it doesn't use dg-add-options arm_v8_1m_mve (on purpose, see comment

Re: [RFC] GNU Vector Extension -- Packed Boolean Vectors

2023-07-13 Thread Tejas Belagod via Gcc-patches
On 7/3/23 1:31 PM, Richard Biener wrote: On Mon, Jul 3, 2023 at 8:50 AM Tejas Belagod wrote: On 6/29/23 6:55 PM, Richard Biener wrote: On Wed, Jun 28, 2023 at 1:26 PM Tejas Belagod wrote: From: Richard Biener Date: Tuesday, June 27, 2023 at 12:58 PM To: Tejas Belagod Cc: gcc-patches@

[PATCH][RFC] tree-optimization/88540 - FP x > y ? x : y if-conversion without -ffast-math

2023-07-13 Thread Richard Biener via Gcc-patches
The following makes sure that FP x > y ? x : y style max/min operations are if-converted at the GIMPLE level. While we can neither match it to MAX_EXPR nor .FMAX as both have different semantics with IEEE than the ternary ?: operation we can make sure to maintain this form as a COND_EXPR so backen

Re: [PATCH ver 3] rs6000, fix vec_replace_unaligned built-in arguments

2023-07-13 Thread Kewen.Lin via Gcc-patches
Hi Carl, on 2023/7/8 04:18, Carl Love wrote: > > GCC maintainers: > > Version 3, added code to altivec_resolve_overloaded_builtin so the > correct instruction is selected for the size of the second argument. > This restores the instruction counts to the original values where the > correct instr

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-13 Thread Jonathan Wakely via Gcc-patches
On Wed, 12 Jul 2023 at 21:42, Ken Matsui wrote: > > On Wed, Jul 12, 2023 at 3:01 AM Jonathan Wakely wrote: > > > > On Mon, 10 Jul 2023 at 06:51, Ken Matsui via Libstdc++ > > wrote: > > > > > > Hi, > > > > > > Here is the benchmark result for is_pointer: > > > > > > https://github.com/ken-matsui/

Re: [PATCH v2] RISC-V: Refactor riscv mode after for VXRM and FRM

2023-07-13 Thread Kito Cheng via Gcc-patches
Hmmm, anyway, I guess it's not worth spending any more of your time, LGTM for v3 :) On Thu, Jul 13, 2023 at 5:10 PM Li, Pan2 via Gcc-patches wrote: > > It can pass the selftest with below diff based on v3, but got ICE when build > newlib. > > /home/pli/repos/gcc/222/riscv-gnu-toolchain/newlib/n

RE: [PATCH v2] RISC-V: Refactor riscv mode after for VXRM and FRM

2023-07-13 Thread Li, Pan2 via Gcc-patches
It can pass the selftest with below diff based on v3, but got ICE when build newlib. /home/pli/repos/gcc/222/riscv-gnu-toolchain/newlib/newlib/libc/time/../time/strftime.c:1426:1: internal compiler error: in reg_overlap_mentioned_p, at rtlanal.cc:1928 1426 | } | ^ 0x87241f reg_overlap_men

[PATCH] m2, build: Use LDLFAGS for mklink

2023-07-13 Thread Rainer Orth
When trying to bootstrap current trunk on macOS 14.0 beta 3 with Xcode 15 beta 4, the build failed running mklink in stage 2: unset CC ; m2/boot-bin/mklink -s --langc++ --exit --name m2/mc-boot/main.cc /vol/gcc/src/hg/master/darwin/gcc/m2/init/mcinit dyld[55825]: Library not loaded: /vol/gcc/lib/

[PATCH 14/14] fortran: Pass pre-calculated class container argument [pr110618]

2023-07-13 Thread Mikael Morin via Gcc-patches
Pass already evaluated class container argument from gfc_conv_procedure_call down to gfc_add_finalizer_call through gfc_deallocate_scalar_with_status and gfc_deallocate_with_status, to avoid repeatedly evaluating the same data reference expressions in the generated code. PR fortran/110618

Re: Re: [PATCH] SSA MATH: Support COND_LEN_FMA for floating-point math optimization

2023-07-13 Thread juzhe.zh...@rivai.ai
Hi, Richard. >> either before or after white-space seems broken. I use clang-format with the format in gcc/contrib/format. I manually adjust it, could you take a look to see whether the format issue is still there? I have address all your comments with V2 patch: https://gcc.gnu.org/pipermail/gc

[PATCH V2] SSA MATH: Support COND_LEN_FMA for floating-point math optimization

2023-07-13 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Richard and Richi. Previous patch we support COND_LEN_* binary operations. However, we didn't support COND_LEN_* ternary. Now, this patch support COND_LEN_* ternary. Consider this following case: #define TEST_TYPE(TYPE)

[PATCH 13/14] fortran: Use pre-evaluated class container if available [PR110618]

2023-07-13 Thread Mikael Morin via Gcc-patches
Add the possibility to provide a pre-evaluated class container argument to gfc_add_finalizer to avoid repeatedly evaluating data reference expressions in the generated code. PR fortran/110618 gcc/fortran/ChangeLog: * trans.h (gfc_add_finalizer_call): Add class container argument.

[PATCH 09/14] fortran: Inline variable definition

2023-07-13 Thread Mikael Morin via Gcc-patches
The variable has_finalizer is only used in one place, inline its definition there. gcc/fortran/ChangeLog: * trans.cc (gfc_add_finalizer_call): Inline definition of variable has_finalizer. Merge nested conditions. --- gcc/fortran/trans.cc | 16 +++- 1 file changed, 7

  1   2   >