[PATCH] rtl-optimization/109585 - alias analysis typo

2023-04-24 Thread Richard Biener via Gcc-patches
When r10-514-gc6b84edb6110dd2b4fb improved access path analysis it introduced a typo that triggers when there's an access to a trailing array in the first access path leading to false disambiguation. Bootstrapped and tested on x86_64-unknown-linux-gnu. Honza, does this look OK? Thanks, Richard.

Re: [PATCH v2] testsuite: Add testcase for sparc ICE [PR105573]

2023-04-24 Thread Richard Biener via Gcc-patches
On Mon, 24 Apr 2023, Sam James wrote: > r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added > a test case for target/arm but the duplicate PR105573 has a test case for > target/sparc that was uncommitted until now. Pushed. > 2023-04-21 Sam James > PR tree-opt

Re: [PATCH] RISC-V: Enable basic RVV auto-vectorization support

2023-04-24 Thread Jeff Law via Gcc-patches
On 4/6/23 19:25, juzhe.zh...@rivai.ai wrote: From: Juzhe-Zhong Enable basic auto-vectorization support of WHILE_LEN/LEN_LOAD/LEN_STORE. gcc/ChangeLog: * config/riscv/riscv-protos.h (preferred_simd_mode): New function. (expand_while_len): Ditto. * config/riscv/risc

Re: Re: [PATCH] RISC-V: Add RVV auto-vectorization compile option

2023-04-24 Thread juzhe.zh...@rivai.ai
Ideally, LMUL should be dynamically picked by compiler according to the user codes. However, GCC doesn't support it yet and it's not a easy feature to be supported in the future. My plan is that we let LMUL picked statically according to compile option and we fully support and test LMUL = 1/2/

Re: [PATCH] RISC-V: Add RVV auto-vectorization compile option

2023-04-24 Thread Jeff Law via Gcc-patches
On 4/6/23 19:21, juzhe.zh...@rivai.ai wrote: From: Juzhe-Zhong The next patch to enable basic RVV auto-vectorization of VLA auto-vectorization (RVV_SCALABLE) and fixed-length VLS auto-vectorization (RVV_FIXED_VLMAX). We will support RVV_FIXED_VLMIN in the future. gcc/ChangeLog:

Re: [PATCH] RISC-V: Fix incorrect condition of EEW = 64 mode

2023-04-24 Thread Jeff Law via Gcc-patches
On 4/6/23 19:11, juzhe.zh...@rivai.ai wrote: From: Juzhe-Zhong This patch should be merged before this patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614935.html According to RVV ISA, the EEW = 64 is enable only when -march=*zve64* Current condition is incorrect, since -march=*

Re: [PATCH v7] RISCV: Inline subword atomic ops

2023-04-24 Thread Jeff Law via Gcc-patches
On 4/18/23 15:41, Patrick O'Neill wrote: RISC-V has no support for subword atomic operations; code currently generates libatomic library calls. This patch changes the default behavior to inline subword atomic calls (using the same logic as the existing library call). Behavior can be specified

Re: [PATCH] powerpc: Fix up *branch_anddi3_dot for -m32 -mpowerpc64 [PR109566]

2023-04-24 Thread Kewen.Lin via Gcc-patches
Hi Jakub, Thanks for the prompt fix! on 2023/4/24 23:54, Jakub Jelinek wrote: > Hi! > > The following testcase reduced from newlib ICEs on powerpc-linux, > with -O2 -m32 -mpowerpc64 since r12-6433 PR102239 optimization was > added and on the original testcase since some ranger improvements in >

[PATCH 1] Add alternative testcase of phi-opt-25.c that tests phiopt

2023-04-24 Thread Andrew Pinski via Gcc-patches
Right now phi-opt-25.c has tests like `a ? func(a) : CST` but if we add the simplifications to match.pd, then phi-opt-25.c will no longer be testing phiopt to make sure these get optimized. So this adds an alternative version which is designed to test phiopt. Committed as obvious after testing the

Re: [xstormy16] Add extendhisi2 and zero_extendhisi2 patterns to stormy16.md

2023-04-24 Thread Jeff Law via Gcc-patches
On 4/23/23 04:38, Roger Sayle wrote: On 4/33/23, Jeff Law wrote: On 4/22/23 14:57, Roger Sayle wrote: Whilst there, I also fixed the instruction lengths and formatting of the zero_extendqihi2 pattern. Then, mostly for documentation purposes as the 'T' constraint isn't yet implemented, I've

Re: [GCC14 QUEUE PATCH] RISC-V: Optimize fault only first load

2023-04-24 Thread Jeff Law via Gcc-patches
On 4/23/23 16:58, 钟居哲 wrote: Hi, Jeff. I have fixed patches as you suggested: https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616515.html https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616518.html

Re: [PATCH v1] [RFC] Improve folding for comparisons with zero in tree-ssa-forwprop.

2023-04-24 Thread Jeff Law via Gcc-patches
On 4/24/23 02:06, Richard Biener via Gcc-patches wrote: On Fri, Apr 21, 2023 at 11:01 PM Philipp Tomsich wrote: Any guidance on the next steps for this patch? I think we want to perform this transform later, in particular when the test is a loop exit test we do not want to do it as it p

Re: [PATCH] aarch64: Add the cost model for Neoverse N1

2023-04-24 Thread Evandro Menezes via Gcc-patches
Sorry, but it seems that, before sending, the email client is stripping leading spaces. I’m attaching the file here. -- Evandro Menezes ◊ evan...@yahoo.com ◊ Austin, TX Άγιος ο Θεός ⁂ ܩܕܝܫܐ ܐܢ̱ܬ ܠܐ ܡܝܘܬܐ ⁂ Sanctus Deus > Em 24 de abr. de 2023, à(s) 17:48, Evandro Menezes > escreveu: > > Hi,

Re: [PATCH] aarch64: Add the cost model for Neoverse N1

2023-04-24 Thread Evandro Menezes via Gcc-patches
Hi, Tamara. Does this work? Thank you, -- Evandro Menezes ◊ evan...@yahoo.com ◊ Austin, TX Άγιος ο Θεός ⁂ ܩܕܝܫܐ ܐܢ̱ܬ ܠܐ ܡܝܘܬܐ ⁂ Sanctus Deus > Em 24 de abr. de 2023, à(s) 12:37, Tamar Christina > escreveu: > > Hi Evandro, > > I wanted to give this patch a try, but the diff seems corrupt, t

[PATCH v2] testsuite: Add testcase for sparc ICE [PR105573]

2023-04-24 Thread Sam James via Gcc-patches
r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added a test case for target/arm but the duplicate PR105573 has a test case for target/sparc that was uncommitted until now. 2023-04-21 Sam James PR tree-optimization/105312 PR target/105573 * gcc/te

Re: [PATCH] testsuite: Add testcase for sparc ICE [PR105573]

2023-04-24 Thread Sam James via Gcc-patches
Richard Biener writes: > On Fri, 21 Apr 2023, Sam James wrote: > >> r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added >> a test case for target/arm but the duplicate PR105573 has a test case for >> target/sparc that was uncommitted until now. > > OK. But see below for

[PATCH 2/7] PHIOPT: Rename tree_ssa_phiopt_worker to pass_phiopt::execute

2023-04-24 Thread Andrew Pinski via Gcc-patches
Now that store elimination and phiopt does not share outer code, we can move tree_ssa_phiopt_worker directly into pass_phiopt::execute and remove many declarations (prototypes) from the file. gcc/ChangeLog: * tree-ssa-phiopt.cc (two_value_replacement): Remove prototype. (m

[PATCH 6/7] MATCH: Factor out code that for min max detection with constants

2023-04-24 Thread Andrew Pinski via Gcc-patches
This factors out some of the code from the min/max detection from match.pd into a function so it can be reused in other places. This is mainly used to detect the conversions of >= to > which causes the integer values to be changed by one. OK? Bootstrapped and tested on x86_64-linux-gnu. gcc/Chang

[PATCH 7/7] MATCH: Add patterns from phiopt's minmax_replacement

2023-04-24 Thread Andrew Pinski via Gcc-patches
This adds a few patterns from phiopt's minmax_replacement for (A CMP B) ? MIN/MAX : MIN/MAX . It is progress to remove minmax_replacement from phiopt. There are still some more cases dealing with constants on the edges (0/INT_MAX) to handle in match. OK? Bootstrapped and tested on x86_64-linux-gn

[PATCH 5/7] PHIOPT: Allow MIN/MAX to have up to 2 MIN/MAX expressions for early phiopt

2023-04-24 Thread Andrew Pinski via Gcc-patches
In the early PHIOPT mode, the original minmax_replacement, would replace a PHI node with up to 2 min/max expressions in some cases, this allows for that too. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * tree-ssa-phiopt.cc (phiopt_early_allow): All

[PATCH 1/7] PHIOPT: Split out store elimination from phiopt

2023-04-24 Thread Andrew Pinski via Gcc-patches
Since the last cleanups, it made easier to see that we should split out the store elimination worker from tree_ssa_phiopt_worker function. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * tree-ssa-phiopt.cc (tree_ssa_phiopt_worker): Remove do_

[PATCH 3/7] PHIOPT: Move store_elim_worker into pass_cselim::execute

2023-04-24 Thread Andrew Pinski via Gcc-patches
This simple patch moves the body of store_elim_worker direclty into pass_cselim::execute. Also removes unneeded prototypes too. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * tree-ssa-phiopt.cc (cond_store_replacement): Remove prototype.

[PATCH 0/7] Some more phiopt cleanups and double minmax to match

2023-04-24 Thread Andrew Pinski via Gcc-patches
The first 3 patches of this patch series is about some more phiopt cleanups dealing with the worker functions being folded into now the ::execute functions. The last 4 are allowing diamond based min/max optimization to be done in match instead of manually in phiopt. Note I have not removed minmax_

[PATCH 4/7] MIN/MAX should be treated similar as comparisons for trapping

2023-04-24 Thread Andrew Pinski via Gcc-patches
While looking into moving optimizations from minmax_replacement in phiopt to match.pd, I Noticed that min/max were considered trapping even if -ffinite-math-only was being used. This changes those expressions to be similar as comparisons so that they are not considered trapping if -ffinite-math-onl

Re: [PATCH] c: Fix up error-recovery on non-empty VLA initializers [PR109409]

2023-04-24 Thread Joseph Myers
On Fri, 14 Apr 2023, Jakub Jelinek via Gcc-patches wrote: > Hi! > > On the following testcase we ICE, because after we emit the > variable-sized object may not be initialized except with an empty initializer > error we don't really reset the initializer to error_mark_node and then at > -Wformat c

Re: [PATCH] c: Fix up error-recovery on functions initialized as variables [PR109412]

2023-04-24 Thread Joseph Myers
On Fri, 14 Apr 2023, Jakub Jelinek via Gcc-patches wrote: > Hi! > > The change to allow empty initializers in C broke error-recovery on the > following testcase. We are emitting function %qD is initialized like a > variable error early; if the initializer is non-empty, we just emit > another err

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

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

Re: [PATCH v3] libgfortran: Replace mutex with rwlock

2023-04-24 Thread Bernhard Reutner-Fischer via Gcc-patches
Hi! [please do not top-post] On Thu, 20 Apr 2023 21:13:08 +0800 "Zhu, Lipeng" wrote: > Hi Bernhard, > > Thanks for your questions and suggestions. > The rwlock could allow multiple threads to have concurrent read-only > access to the cache/unit list, only a single writer is allowed. right.

Re: [PATCH v4 3/4] ree: Main functionality to improve ree pass for rs6000 target.

2023-04-24 Thread Surya Kumari Jangala via Gcc-patches
On 21/04/23 8:51 pm, Ajit Agarwal via Gcc-patches wrote: > +/* Return TRUE if the cfg has following properties. > + bb1 > + |\ > + | \ > + | bb2 > + | / > + bb3 > + > + whereas bb1 has IF_THEN_ELSE and bb2 has the definition and bb3 has > + zero/sign/AND extension

Re: [PATCH] Fortran: function results never have the ALLOCATABLE attribute [PR109500]

2023-04-24 Thread Steve Kargl via Gcc-patches
On Sat, Apr 22, 2023 at 08:43:53PM +0200, Mikael Morin wrote: > > > OK, let's go with your patch as originally submitted then. > Mikael, thanks for looking at the original patch and suggested an alternative location to attempt to fix the bug. Halrald, thanks for following up on Mikael's suggest

RE: [PATCH] aarch64: Add the cost model for Neoverse N1

2023-04-24 Thread Tamar Christina via Gcc-patches
Hi Evandro, I wanted to give this patch a try, but the diff seems corrupt, the whitespaces at the start of the context lines seem to have gone missing. Could you try resending it? Thanks, Tamar > -Original Message- > From: Gcc-patches bounces+tamar.christina=arm@gcc.gnu.org> On Be

Re: [PATCH] Implement std::advance for istreambuf_iterator using pubseekoff

2023-04-24 Thread François Dumont via Gcc-patches
I had totally forgotten about it myself. The occasion to take a fresh look at it. Here is a new version considering 1st pubseekoff call returned value to find out if it can be used. I removed the check/comparison with 2nd call result as it's not usable. In new 4_neg.cc test case if I ask to ad

Re: [PATCH v7] RISCV: Inline subword atomic ops

2023-04-24 Thread Patrick O'Neill
Ping Also here's the corrected link for Jeff's comments: https://inbox.sourceware.org/gcc-patches/f965671f-5997-0220-8831-a94e8c68d...@gmail.com/T/#m53e5d46a94868e68693e0d79455ca5343cf275a9 Patrick On 4/18/23 14:41, Patrick O'Neill wrote: RISC-V has no support for subword atomic operations;

Re: [PATCH] Pass correct type to irange::contains_p() in ipa-cp.cc.

2023-04-24 Thread Aldy Hernandez via Gcc-patches
On 4/24/23 14:35, Richard Biener wrote: On Mon, Apr 24, 2023 at 2:32 PM Aldy Hernandez wrote: On 4/24/23 14:10, Richard Biener wrote: On Mon, Apr 24, 2023 at 1:51 PM Aldy Hernandez wrote: On 4/24/23 10:30, Richard Biener wrote: On Mon, Apr 24, 2023 at 9:44 AM Aldy Hernandez via Gcc-

Re: [Patch, fortran] PRs 105152, 100193, 87946, 103389, 104429 and 82774

2023-04-24 Thread Bernhard Reutner-Fischer via Gcc-patches
On Sun, 23 Apr 2023 23:48:03 +0200 Harald Anlauf via Fortran wrote: > Am 22.04.23 um 10:32 schrieb Paul Richard Thomas via Gcc-patches: > > PR103931 - I couldn't reproduce the bug, which involves 'ambiguous c_ptr'. > > To judge by the comments, it seems that this bug is a bit elusive. See Haral

Re: [PATCH] libstdc++: Fix __max_diff_type::operator>>= for negative values

2023-04-24 Thread Jonathan Wakely via Gcc-patches
On Mon, 24 Apr 2023 at 17:24, Patrick Palka via Libstdc++ wrote: > > This patch fixes sign bit propagation when right-shifting a negative > __max_diff_type value by more than one, a bug which our test coverage > failed to uncover until r14-159-g03cebd304955a6 fixed the front end's > 'signed typede

Re: [PATCH] Implement range-op entry for sin/cos.

2023-04-24 Thread Jeff Law via Gcc-patches
On 4/24/23 10:05, Siddhesh Poyarekar wrote: On 2023-04-24 12:03, Jakub Jelinek wrote: On Thu, Apr 20, 2023 at 01:57:55PM -0400, Siddhesh Poyarekar wrote: Similarly for other functions which have other ranges, perhaps not with so nice round numbers.  Say asin has [-pi/2, pi/2] range, those nu

Re: [r14-159 Regression] FAIL: std/ranges/iota/max_size_type.cc execution test on Linux/x86_64

2023-04-24 Thread Jonathan Wakely via Gcc-patches
On Mon, 24 Apr 2023 at 17:27, Patrick Palka wrote: > > On Sun, 23 Apr 2023, Jonathan Wakely wrote: > > > > > > > On Saturday, April 22, 2023, Jakub Jelinek wrote: > > > On Sat, Apr 22, 2023 at 11:30:24AM +0800, haochen.jiang via Gcc-patches > > > wrote: > > >> On Linux/x86_64, > > >> > > >> 03ce

Re: [PATCH] libstdc++: Fix __max_diff_type::operator>>= for negative values

2023-04-24 Thread Patrick Palka via Gcc-patches
On Mon, 24 Apr 2023, Patrick Palka wrote: > This patch fixes sign bit propagation when right-shifting a negative > __max_diff_type value by more than one, a bug which our test coverage > failed to uncover until r14-159-g03cebd304955a6 fixed the front end's > 'signed typedef-name' handling (which i

Re: [r14-159 Regression] FAIL: std/ranges/iota/max_size_type.cc execution test on Linux/x86_64

2023-04-24 Thread Patrick Palka via Gcc-patches
On Sun, 23 Apr 2023, Jonathan Wakely wrote: > > > On Saturday, April 22, 2023, Jakub Jelinek wrote: > > On Sat, Apr 22, 2023 at 11:30:24AM +0800, haochen.jiang via Gcc-patches > > wrote: > >> On Linux/x86_64, > >> > >> 03cebd304955a6b9c5607e09312d77f1307cc98e is the first bad commit > >> commi

[PATCH] libstdc++: Make __max_size_type and __max_diff_type structural

2023-04-24 Thread Patrick Palka via Gcc-patches
This patch makes these integer-class type structural types by changing their private data members into public ones, which allows them to be used as NTTP types. I'm not sure if this is required by the standard but it seems handy. Tested on x86_64-pc-linux-gnu, does this look OK for trunk? libstdc

[PATCH] libstdc++: Fix __max_diff_type::operator>>= for negative values

2023-04-24 Thread Patrick Palka via Gcc-patches
This patch fixes sign bit propagation when right-shifting a negative __max_diff_type value by more than one, a bug which our test coverage failed to uncover until r14-159-g03cebd304955a6 fixed the front end's 'signed typedef-name' handling (which is a non-standard extension to the language grammar)

Re: [PATCH] Implement range-op entry for sin/cos.

2023-04-24 Thread Jakub Jelinek via Gcc-patches
On Mon, Apr 24, 2023 at 12:05:43PM -0400, Siddhesh Poyarekar wrote: > On 2023-04-24 12:03, Jakub Jelinek wrote: > > On Thu, Apr 20, 2023 at 01:57:55PM -0400, Siddhesh Poyarekar wrote: > > > > Similarly for other functions which have other ranges, perhaps not with > > > > so > > > > nice round numb

Re: [PATCH] Implement range-op entry for sin/cos.

2023-04-24 Thread Siddhesh Poyarekar
On 2023-04-24 12:03, Jakub Jelinek wrote: On Thu, Apr 20, 2023 at 01:57:55PM -0400, Siddhesh Poyarekar wrote: Similarly for other functions which have other ranges, perhaps not with so nice round numbers. Say asin has [-pi/2, pi/2] range, those numbers aren't exactly representable, but is it an

Re: [PATCH] Implement range-op entry for sin/cos.

2023-04-24 Thread Jakub Jelinek via Gcc-patches
On Thu, Apr 20, 2023 at 01:57:55PM -0400, Siddhesh Poyarekar wrote: > > Similarly for other functions which have other ranges, perhaps not with so > > nice round numbers. Say asin has [-pi/2, pi/2] range, those numbers aren't > > exactly representable, but is it any worse to round those values to

[PATCH] powerpc: Fix up *branch_anddi3_dot for -m32 -mpowerpc64 [PR109566]

2023-04-24 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase reduced from newlib ICEs on powerpc-linux, with -O2 -m32 -mpowerpc64 since r12-6433 PR102239 optimization was added and on the original testcase since some ranger improvements in GCC 13 made it no longer latent on newlib. The problem is that the *branch_anddi3_dot define

Re: [PATCH v3 1/4] ree: Default ree pass for O2 and above for rs6000 target.

2023-04-24 Thread Peter Bergner via Gcc-patches
On 4/24/23 10:28 AM, Jakub Jelinek wrote: > On Mon, Apr 24, 2023 at 10:23:06AM -0500, Peter Bergner wrote: >> On 4/19/23 3:00 PM, Segher Boessenkool wrote: >>> On Wed, Apr 19, 2023 at 11:23:07PM +0530, Ajit Agarwal wrote: * common/config/rs6000/rs6000-common.cc: Add REE pass as a de

Re: [PATCH v3 1/4] ree: Default ree pass for O2 and above for rs6000 target.

2023-04-24 Thread Jakub Jelinek via Gcc-patches
On Mon, Apr 24, 2023 at 10:23:06AM -0500, Peter Bergner wrote: > On 4/19/23 3:00 PM, Segher Boessenkool wrote: > > On Wed, Apr 19, 2023 at 11:23:07PM +0530, Ajit Agarwal wrote: > >>* common/config/rs6000/rs6000-common.cc: Add REE pass as a > >>default rs6000 target pass for O2 and above. >

Re: [PATCH v3 1/4] ree: Default ree pass for O2 and above for rs6000 target.

2023-04-24 Thread Peter Bergner via Gcc-patches
On 4/19/23 3:00 PM, Segher Boessenkool wrote: > On Wed, Apr 19, 2023 at 11:23:07PM +0530, Ajit Agarwal wrote: >> * common/config/rs6000/rs6000-common.cc: Add REE pass as a >> default rs6000 target pass for O2 and above. > > Why only for -O2? Only when optimising at all makes sense, peop

Re: [PATCH] PR tree-optimization/109417 - Check if dependency is valid before using in may_recompute_p.

2023-04-24 Thread Andrew MacLeod via Gcc-patches
On 4/11/23 05:21, Richard Biener via Gcc-patches wrote: On Wed, Apr 5, 2023 at 11:53 PM Jeff Law via Gcc-patches wrote: On 4/5/23 14:10, Andrew MacLeod via Gcc-patches wrote: When a statement is first processed, any SSA_NAMEs that are dependencies are cached for quick future access. if we

Re: [ping][vect-patterns] Refactor widen_plus/widen_minus as internal_fns

2023-04-24 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Thu, Apr 20, 2023 at 3:24 PM Andre Vieira (lists) via Gcc-patches > wrote: >> >> Rebased all three patches and made some small changes to the second one: >> - removed sub and abd optabs from commutative_optab_p, I suspect this >> was a copy paste mistake, >> - removed

Re: [PATCH] Pass correct type to irange::contains_p() in ipa-cp.cc.

2023-04-24 Thread Richard Biener via Gcc-patches
On Mon, Apr 24, 2023 at 2:32 PM Aldy Hernandez wrote: > > > > On 4/24/23 14:10, Richard Biener wrote: > > On Mon, Apr 24, 2023 at 1:51 PM Aldy Hernandez wrote: > >> > >> > >> > >> On 4/24/23 10:30, Richard Biener wrote: > >>> On Mon, Apr 24, 2023 at 9:44 AM Aldy Hernandez via Gcc-patches > >>> w

Re: [PATCH] Pass correct type to irange::contains_p() in ipa-cp.cc.

2023-04-24 Thread Aldy Hernandez via Gcc-patches
On 4/24/23 14:10, Richard Biener wrote: On Mon, Apr 24, 2023 at 1:51 PM Aldy Hernandez wrote: On 4/24/23 10:30, Richard Biener wrote: On Mon, Apr 24, 2023 at 9:44 AM Aldy Hernandez via Gcc-patches wrote: There is a call to contains_p() in ipa-cp.cc which passes incompatible types. Th

Re: [PATCH] Pass correct type to irange::contains_p() in ipa-cp.cc.

2023-04-24 Thread Richard Biener via Gcc-patches
On Mon, Apr 24, 2023 at 1:51 PM Aldy Hernandez wrote: > > > > On 4/24/23 10:30, Richard Biener wrote: > > On Mon, Apr 24, 2023 at 9:44 AM Aldy Hernandez via Gcc-patches > > wrote: > >> > >> There is a call to contains_p() in ipa-cp.cc which passes incompatible > >> types. This currently works be

Re: [PATCH 6/6] PHIOPT: Add support for diamond shaped bb to match_simplify_replacement

2023-04-24 Thread Richard Biener via Gcc-patches
On Sun, Apr 23, 2023 at 12:13 AM Andrew Pinski via Gcc-patches wrote: > > This adds diamond shaped form of basic blocks to match_simplify_replacement. > This is the patch is the start of removing/moving all > of what minmax_replacement does to match.pd to reduce the code duplication. > > OK? Boots

Re: [PATCH 3/6] PHIOPT: Allow other diamond uses when do_hoist_loads is true

2023-04-24 Thread Richard Biener via Gcc-patches
On Sun, Apr 23, 2023 at 12:13 AM Andrew Pinski via Gcc-patches wrote: > > While working on adding diamond shaped form to match-and-simplify > phiopt, I Noticed that we would not reach there if do_hoist_loads > was true. In the original code before the cleanups it was not > obvious why but after I

Re: [PATCH 2/6] PHIOPT: Cleanup tree_ssa_phiopt_worker code

2023-04-24 Thread Richard Biener via Gcc-patches
On Sun, Apr 23, 2023 at 12:13 AM Andrew Pinski via Gcc-patches wrote: > > This patch cleans up tree_ssa_phiopt_worker by merging > common code. Making do_store_elim handled earlier. > Note this does not change any overall logic of the code, > just moves code around enough to be able to do this. >

Re: [PATCH 5/6] PHIOPT: Ignore predicates for match-and-simplify phi-opt

2023-04-24 Thread Richard Biener via Gcc-patches
On Sun, Apr 23, 2023 at 12:11 AM Andrew Pinski via Gcc-patches wrote: > > This fixes a missed optimization where early phi-opt would > not work when there was predicates. The easiest fix is > to change empty_bb_or_one_feeding_into_p to ignore those > statements while checking for only feeding stat

Re: [PATCH 4/6] PHIOPT: Factor out some code from match_simplify_replacement

2023-04-24 Thread Richard Biener via Gcc-patches
On Sun, Apr 23, 2023 at 12:11 AM Andrew Pinski via Gcc-patches wrote: > > This factors out the code checking if we have an empty bb > or one statement that feeds into the phi so it can be used > when adding diamond shaped bb form to match_simplify_replacement > in the next patch. Also allows for s

Re: [PATCH 1/6] PHIOPT: Move check on diamond bb to tree_ssa_phiopt_worker from minmax_replacement

2023-04-24 Thread Richard Biener via Gcc-patches
On Sun, Apr 23, 2023 at 12:11 AM Andrew Pinski via Gcc-patches wrote: > > This moves the check to make sure on the diamond shaped form bbs that > the the two middle bbs are only for that diamond shaped form earlier > in the shared code. > Also remove the redundant check for single_succ_p since tha

Re: [ping][vect-patterns] Refactor widen_plus/widen_minus as internal_fns

2023-04-24 Thread Richard Biener via Gcc-patches
On Thu, Apr 20, 2023 at 3:24 PM Andre Vieira (lists) via Gcc-patches wrote: > > Rebased all three patches and made some small changes to the second one: > - removed sub and abd optabs from commutative_optab_p, I suspect this > was a copy paste mistake, > - removed what I believe to be a superfluou

Re: [PATCH] Pass correct type to irange::contains_p() in ipa-cp.cc.

2023-04-24 Thread Aldy Hernandez via Gcc-patches
On 4/24/23 10:30, Richard Biener wrote: On Mon, Apr 24, 2023 at 9:44 AM Aldy Hernandez via Gcc-patches wrote: There is a call to contains_p() in ipa-cp.cc which passes incompatible types. This currently works because deep in the call chain, the legacy code uses tree_int_cst_lt which perfor

Re: [PATCH] rs6000: Fix predicate for const vector in sldoi_to_mov [PR109069]

2023-04-24 Thread Segher Boessenkool
Hi! On Mon, Mar 27, 2023 at 04:09:39PM +0800, Kewen.Lin wrote: > As PR109069 shows, commit r12-6537-g080a06fcb076b3 which > introduces define_insn_and_split sldoi_to_mov adopts > easy_vector_constant for const vector of interest, but it's > wrong since predicate easy_vector_constant doesn't guaran

RE: Re: [PATCH v2] RISC-V: Bugfix for RVV vbool*_t vn_reference_equal.

2023-04-24 Thread Li, Pan2 via Gcc-patches
Hi, Just synced this patch with upstream, and passed the X86 bootstrap and regression test already. Pan -Original Message- From: Li, Pan2 Sent: Thursday, April 20, 2023 9:57 PM To: kito.ch...@sifive.com Cc: gcc-patches ; Kito.cheng ; Wang, Yanzhang ; juzhe.zh...@rivai.ai Subject: RE:

Re: [PATCH] doc: Update install.texi for GCC 13

2023-04-24 Thread Richard Biener via Gcc-patches
On Mon, 24 Apr 2023, Rainer Orth wrote: > Hi Gerald, > > > On Fri, 21 Apr 2023, Rainer Orth wrote: > >> * We used a mixture of Solaris 2 and Solaris references. Since Solaris > >> 1/SunOS 4 is ancient history by now, consistently use Solaris > >> everywhere. Likewise, explicit references to

[PATCH][committed] aarch64: Add mulv2di3 expander for TARGET_SVE

2023-04-24 Thread Kyrylo Tkachov via Gcc-patches
Hi all, Motivated by a recent LLVM patch I saw, we can use SVE for 64-bit vector integer MUL (plain Advanced SIMD doesn't support it). Since the Advanced SIMD regs are just the low 128-bit part of the SVE regs it all works transparently. It's a reasonably straightforward implementation of the mu

Re: [PATCH] LoongArch: Enable shrink wrapping

2023-04-24 Thread Lulu Cheng
Ok, I will do spec performance test comparison as soon as possible. Thanks! 在 2023/4/23 下午9:19, Xi Ruoyao 写道: This commit implements the target macros for shrink wrapping of function prologues/epilogues shrink wrapping on LoongArch. Bootstrapped and regtested on loongarch64-linux-gnu. I don't

[PATCH (pushed)] MAINTAINERS: fix sorting of names

2023-04-24 Thread Martin Liška
ChangeLog: * MAINTAINERS: Fix sorting. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 8822d9642f7..b76e1a131d9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -319,6 +319,7 @@ from other maintainers or reviewers.

Re: [PATCH] doc: Update install.texi for GCC 13

2023-04-24 Thread Rainer Orth
Hi Gerald, > On Fri, 21 Apr 2023, Rainer Orth wrote: >> * We used a mixture of Solaris 2 and Solaris references. Since Solaris >> 1/SunOS 4 is ancient history by now, consistently use Solaris >> everywhere. Likewise, explicit references to Solaris 11 can go in >> many places since Solaris

Re: [PATCH] Turn on LRA on all targets

2023-04-24 Thread Uros Bizjak via Gcc-patches
On Mon, Apr 24, 2023 at 11:19 AM Segher Boessenkool wrote: > > On Sun, Apr 23, 2023 at 11:06:41PM +0200, Uros Bizjak wrote: > > > I send this patch now so that people can start testing. I don't plan to > > > commit this for another week at least, for a week after GCC 13 release I > > > guess? Ho

Re: [PATCH] Turn on LRA on all targets

2023-04-24 Thread Segher Boessenkool
On Mon, Apr 24, 2023 at 10:19:23AM +0200, Richard Biener wrote: > On Sun, Apr 23, 2023 at 6:48 PM Segher Boessenkool > wrote: > > > > This minimal patch enables LRA for all targets. It does not clean up > > the target code, nor does it do anything to generic code: it just > > deletes all target d

Re: [PATCH] RFC: New compact syntax for insn and insn_split in Machine Descriptions

2023-04-24 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: >> -Original Message- >> From: Richard Sandiford >> Sent: Friday, April 21, 2023 6:19 PM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw >> >> Subject: Re: [PATCH] RFC: New compact syntax for insn and insn_split in >> Machine Descript

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

2023-04-24 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > gcc/ChangeLog: > * tree-ssa-forwprop.cc (is_combined_permutation_identity): Try to > simplify two successive VEC_PERM_EXPRs with single operand and same > mask, where mask chooses elements in reverse order. > > gcc/testesuite/ChangeLog: > * gcc

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

2023-04-24 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > [aarch64] Recursively intialize even and odd sub-parts and merge with zip1. > > gcc/ChangeLog: > * config/aarch64/aarch64.cc (aarch64_expand_vector_init_fallback): > Rename > aarch64_expand_vector_init to this, and remove interleaving case. > Recur

Re: [PATCH] Turn on LRA on all targets

2023-04-24 Thread Segher Boessenkool
On Sun, Apr 23, 2023 at 11:06:41PM +0200, Uros Bizjak wrote: > > I send this patch now so that people can start testing. I don't plan to > > commit this for another week at least, for a week after GCC 13 release I > > guess? How does that plan sound to people? > > An old patch to enable Alpha is

RE: [PATCH] RFC: New compact syntax for insn and insn_split in Machine Descriptions

2023-04-24 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Friday, April 21, 2023 6:19 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > > Subject: Re: [PATCH] RFC: New compact syntax for insn and insn_split in > Machine Descriptions > > Tamar Christina writ

Re: [PATCH] aarch64: PR target/109406 Add support for SVE2 unpredicated MUL

2023-04-24 Thread Richard Sandiford via Gcc-patches
Kyrylo Tkachov writes: > Hi all, > > SVE2 supports an unpredicated vector integer MUL form that we can emit from > our SVE expanders > without using up a predicate registers. This patch does so. > As the SVE MUL expansion currently is templated away through a code iterator > I did not split it >

[PATCH] aarch64: PR target/109406 Add support for SVE2 unpredicated MUL

2023-04-24 Thread Kyrylo Tkachov via Gcc-patches
Hi all, SVE2 supports an unpredicated vector integer MUL form that we can emit from our SVE expanders without using up a predicate registers. This patch does so. As the SVE MUL expansion currently is templated away through a code iterator I did not split it off just for this case but instead spe

[PATCH][3/4][committed] aarch64: Convert UABAL and SABAL patterns to standard RTL codes

2023-04-24 Thread Kyrylo Tkachov via Gcc-patches
Hi all, With the SABDL and UABDL patterns converted, the accumulating forms of them UABAL and SABAL are not much more complicated. There's an accumulator argument that we, err, accumulate into with a PLUS once all the widening is done. Some necessary renaming of patterns relating to the removal

[PATCH][2/4][committed] aarch64: Convert UABDL2 and SABDL2 patterns to standard RTL codes

2023-04-24 Thread Kyrylo Tkachov via Gcc-patches
Hi all, Similar to the previous patch for UABDL and SABDL, this patch covers the *2 versions that vec_select the high half of its input to do the asbsdiff and extend. A define_expand is added for the intrinsic to create the "select-high-half" RTX the pattern expects. Bootstrapped and tested on

[PATCH][4/4][committed] aarch64: Convert UABAL2 and SABAL2 patterns to standard RTL codes

2023-04-24 Thread Kyrylo Tkachov via Gcc-patches
Hi all, The final patch in the series tackles the most complex of this family of patterns, UABAL2 and SABAL2. These extract the high part of the sources, perform an absdiff on them, widen the result and accumulate. The motivating testcase for this patch (series) is included and the simplificati

[PATCH][1/4][committed] aarch64: Convert UABDL and SABDL patterns to standard RTL codes

2023-04-24 Thread Kyrylo Tkachov via Gcc-patches
Hi all, This is the first patch in a series to improve the RTL representation of the sum-of-absolute-differences patterns in the backend. We can use standard RTL codes and remove some unspecs. For UABDL and SABDL we have a widening of the result so we can represent uabdl (x, y) as (zero_extend (

Re: [PATCH] Turn on LRA on all targets

2023-04-24 Thread Andreas Schwab
Here is the result for m68k: libtool: compile: /daten/aranym/gcc/gcc-20230424/Build/./gcc/xgcc -shared-libgcc -B/daten/aranym/gcc/gcc-20230424/Build/./gcc -nostdinc++ -L/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc++-v3/src -L/daten/aranym/gcc/gcc-20230424/Build/m68k-linux/libstdc

Re: [PATCH] RFC: New compact syntax for insn and insn_split in Machine Descriptions

2023-04-24 Thread Richard Sandiford via Gcc-patches
Richard Sandiford writes: > Tamar Christina writes: >> Hi All, >> >> This patch adds support for a compact syntax for specifying constraints in >> instruction patterns. Credit for the idea goes to Richard Earnshaw. >> >> I am sending up this RFC to get feedback for it's inclusion in GCC 14. >> Wi

Re: [PATCH] Pass correct type to irange::contains_p() in ipa-cp.cc.

2023-04-24 Thread Richard Biener via Gcc-patches
On Mon, Apr 24, 2023 at 9:44 AM Aldy Hernandez via Gcc-patches wrote: > > There is a call to contains_p() in ipa-cp.cc which passes incompatible > types. This currently works because deep in the call chain, the legacy > code uses tree_int_cst_lt which performs the operation with > widest_int. Wi

[PATCH][committed] aarch64: Add pattern to match zero-extending scalar result of ADDLV

2023-04-24 Thread Kyrylo Tkachov via Gcc-patches
Hi all, The vaddlv_u8 and vaddlv_u16 intrinsics produce a widened scalar result (uint16_t and uint32_t). The ADDLV instructions themselves zero the rest of the V register, which gives us a free zero-extension to 32 and 64 bits, similar to how it works on the GP reg side. Because we don't model t

Re: [PATCH] Turn on LRA on all targets

2023-04-24 Thread Richard Biener via Gcc-patches
On Sun, Apr 23, 2023 at 6:48 PM Segher Boessenkool wrote: > > This minimal patch enables LRA for all targets. It does not clean up > the target code, nor does it do anything to generic code: it just > deletes all target definitions of TARGET_LRA_P. > > There are three kinds of changes: > > 1) Tar

Re: [PATCH v1] [RFC] Improve folding for comparisons with zero in tree-ssa-forwprop.

2023-04-24 Thread Richard Biener via Gcc-patches
On Fri, Apr 21, 2023 at 11:01 PM Philipp Tomsich wrote: > > Any guidance on the next steps for this patch? I think we want to perform this transform later, in particular when the test is a loop exit test we do not want to do it as it prevents coalescing of the IV on the backedge at out-of-SSA tim

Re: Stabilize temporary variable names

2023-04-24 Thread Richard Biener via Gcc-patches
On Fri, 21 Apr 2023, Jan Hubicka wrote: > Hi, > Michal Jires implemented quite well working prototype of cache for WPA which > makes > it to re-use partitions from from earlier build when package is rebulit with > smaller > changes. It should be useful to improve edit/compile/debug cycles when

[PATCH] Pass correct type to irange::contains_p() in ipa-cp.cc.

2023-04-24 Thread Aldy Hernandez via Gcc-patches
There is a call to contains_p() in ipa-cp.cc which passes incompatible types. This currently works because deep in the call chain, the legacy code uses tree_int_cst_lt which performs the operation with widest_int. With the upcoming removal of legacy, contains_p() will be stricter. OK pending tes

Re: [PATCH] testsuite: Add testcase for sparc ICE [PR105573]

2023-04-24 Thread Richard Biener via Gcc-patches
On Fri, 21 Apr 2023, Sam James wrote: > r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added > a test case for target/arm but the duplicate PR105573 has a test case for > target/sparc that was uncommitted until now. OK. But see below for a question > 2023-04-21 Sam Jame

Re: [PATCH] gcc/m2: Drop references to $(P)

2023-04-24 Thread Richard Biener via Gcc-patches
On Fri, 21 Apr 2023, Arsen Arsenovi? wrote: > > Jakub Jelinek writes: > > > Doesn't fix any regression, so not ok for 13.1 and I wouldn't bother > > for 13.2 either. > > Okay, but it can affect --enable-languages=all in a slim edge case. > > Why not 13.2? It seems sufficiently simple. If it