Re: Intel AVX10.1 Compiler Design and Support

2023-08-21 Thread Richard Biener via Gcc-patches
On Mon, Aug 21, 2023 at 11:34 AM Richard Biener wrote: > > On Mon, Aug 21, 2023 at 10:28 AM Hongtao Liu wrote: > > > > On Mon, Aug 21, 2023 at 4:09 PM Jakub Jelinek wrote: > > > > > > On Mon, Aug 21, 2023 at 09:36:16AM +0200, Richard Biener via Gcc-patches &

[PATCH] tree-optimization/111082 - bogus promoted min

2023-08-21 Thread Richard Biener via Gcc-patches
vectorize_slp_instance_root_stmt promotes operations with undefined overflow to unsigned arithmetic but fails to consider operations that do not overflow like MIN which it turned into MIN with wrong signedness and in the case of the PR an unsupported operation. The following rectifies this. Bootst

[PATCH] Fix gcc.dg/vect/bb-slp-46.c FAIL

2023-08-21 Thread Richard Biener via Gcc-patches
When relaxing vectorization of possibly overflowing reductions I failed to update a testcase that will now vectorize and no longer test for what it was written for. The following replaces the vectorizable add with a division. Tested on x86_64-unknown-linux-gnu, pushed. * gcc.dg/vect/bb-s

[PATCH] Fix gcc.dg/vect/bb-slp-subgroups-2.c with 256bit vectors

2023-08-21 Thread Richard Biener via Gcc-patches
The following adds vect128, vect256 and vect512 effective targets and adjusts gcc.dg/vect/bb-slp-subgroups-2.c accordingly. Tested on x86_64-unknown-linux-gnu, pushed. * gcc.dg/vect/bb-slp-subgroups-2.c: Properly handle the vect256 case. --- gcc/testsuite/gcc.dg/vect/bb-slp-subgr

[PATCH] Fix FAIL: gcc.target/i386/pr87007-5.c

2023-08-21 Thread Richard Biener via Gcc-patches
The following fixes the gcc.target/i386/pr87007-5.c testcase which changed code generation again after the recent sinking improvements. We now have vxorps %xmm0, %xmm0, %xmm0 vsqrtsd d2(%rip), %xmm0, %xmm0 and an unnecessary xor again in one case, the other vsqrtsd has a register

Re: [PATCH] Fix FAIL: gcc.target/i386/pr87007-5.c

2023-08-21 Thread Richard Biener via Gcc-patches
On Mon, 21 Aug 2023, Hongtao Liu wrote: > On Mon, Aug 21, 2023 at 8:25?PM Richard Biener via Gcc-patches > wrote: > > > > The following fixes the gcc.target/i386/pr87007-5.c testcase which > > changed code generation again after the recent sinking impro

Re: [PATCH V5] VECT: Support loop len control on EXTRACT_LAST vectorization

2023-08-21 Thread Richard Biener via Gcc-patches
On Mon, 21 Aug 2023, Juzhe-Zhong wrote: > Co-Authored-By: Kewen.Lin > > Hi, @Richi and @Richard, base on previous disscussion, I simpily fix issuses > for > powerpc and s390 with your suggestions: > > - machine_mode len_load_mode = get_len_load_store_mode > -(loop_vinfo->vector_mode, true

Re: [OpenMP/offloading][RFC] How to handle target/device-specifics with C pre-processor (in general, inside 'omp declare variant')

2023-08-22 Thread Richard Biener via Gcc-patches
On Mon, Aug 21, 2023 at 6:23 PM Tobias Burnus wrote: > > RFC – and idea how to handle this best in GCC? See the two examples > below for what we would like to support. > > * * * > > In GCC, we handle OpenMP (and OpenACC) by parsing the input file once, > produce an internal representation (in LTO

Re: Intel AVX10.1 Compiler Design and Support

2023-08-22 Thread Richard Biener via Gcc-patches
On Tue, Aug 22, 2023 at 5:20 AM Jiang, Haochen wrote: > > > -Original Message- > > From: ZiNgA BuRgA > > Sent: Monday, August 21, 2023 5:27 PM > > To: Richard Biener ; Hongtao Liu > > > > Cc: Jiang, Haochen ; gcc-patches@gcc.gnu.org > > Subject: Re: Intel AVX10.1 Compiler Design and Supp

Re: Loop-ch improvements, part 3

2023-08-22 Thread Richard Biener via Gcc-patches
On Tue, 22 Aug 2023, Hongtao Liu wrote: > On Mon, Jul 17, 2023 at 5:18?PM Richard Biener via Gcc-patches > wrote: > > > > On Fri, 14 Jul 2023, Jan Hubicka wrote: > > > > > Hi, > > > loop-ch currently does analysis using ranger for all loops to identify

Re: Intel AVX10.1 Compiler Design and Support

2023-08-22 Thread Richard Biener via Gcc-patches
On Tue, Aug 22, 2023 at 10:34 AM Jakub Jelinek wrote: > > On Tue, Aug 22, 2023 at 09:36:15AM +0200, Richard Biener via Gcc-patches > wrote: > > I think internally we should have conditional 512bit support work across > > AVX512 and AVX10. > > > > I also think it

Re: [PATCH 4/12] Middle-end _BitInt support [PR102989]

2023-08-22 Thread Richard Biener via Gcc-patches
On Wed, 9 Aug 2023, Jakub Jelinek wrote: > Hi! > > The following patch introduces the middle-end part of the _BitInt > support, a new BITINT_TYPE, handling it where needed, except the lowering > pass and sanitizer support. This is OK. Thanks, Richard. > 2023-08-09 Jakub Jelinek > > P

[PATCH] tree-optimization/110269 - restore missed condition folding

2023-06-16 Thread Richard Biener via Gcc-patches
The following makes sure we optimize x != 0 using range info via tree_expr_nonzero_p via match.pd. Bootstrapped and tested on x86_64-unknown-linux-gnu. This causes FAIL: gcc.dg/tree-ssa/pr103257-1.c scan-tree-dump-times optimized "link_error" 0 because we now improve early folding the followin

Re: [PATCH] Check SCALAR_INT_MODE_P in try_const_anchors

2023-06-16 Thread Richard Biener via Gcc-patches
On Fri, 16 Jun 2023, Jiufu Guo wrote: > Hi, > > The const_anchor in cse.cc supports integer constants only. > There is a "gcc_assert (SCALAR_INT_MODE_P (mode))" in > try_const_anchors. > > In the latest code, some non-integer modes are used with const int. > For examples: > "set (mem/c:BLK (xx)

[PATCH 2/2][v2] AVX512 fully masked vectorization

2023-06-16 Thread Richard Biener via Gcc-patches
Compared to v1 this drops the first patch of the series which inlined vect_get_max_nscalars_per_iter. I was able to simplify this final patch to no longer require a hash-map of rgroup_controls but can re-use the existing vector which makes the function meaningful (although unused) for AVX512 as

Re: [PATCH V4] VECT: Support LEN_MASK_{LOAD,STORE} ifn && optabs

2023-06-16 Thread Richard Biener via Gcc-patches
On Thu, 15 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > This patch bootstrap pass on X86, ok for trunk ? OK with me, please give Richard S. a chance to comment before pushing. Thanks, Richard. > Accoding to comments from Richi, split the first patch to add ifn && optabs > of

[PATCH] tree-optimization/110278 - uns < (typeof uns)(uns != 0) is always false

2023-06-16 Thread Richard Biener via Gcc-patches
The following adds two patterns simplifying comparisons, uns < (typeof uns)(uns != 0) is always false and x != (typeof x)(x == 0) is always true. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/110278 * match.pd (uns < (typeof uns)(uns != 0) -> fa

[PATCH] tree-optimization/110243 - kill off IVOPTs split_offset

2023-06-16 Thread Richard Biener via Gcc-patches
IVOPTs has strip_offset which suffers from the same issues regarding integer overflow that split_constant_offset did but the latter was fixed quite some time ago. The following implements strip_offset in terms of split_constant_offset, removing the redundant and incorrect implementation. The impl

Re: [PATCH] tree-ssa-math-opts: Fix up uaddc/usubc pattern matching [PR110271]

2023-06-16 Thread Richard Biener via Gcc-patches
> Am 16.06.2023 um 16:23 schrieb Jakub Jelinek : > > Hi! > > The following testcase ICEs, because I misremembered what the return value > from match_arith_overflow is. It isn't true if __builtin_*_overflow was > matched, but it is true only in the BIT_NOT_EXPR case if stmt was removed. > >

Re: [PATCH] builtins: Add support for clang compatible __builtin_{add, sub}c{, l, ll} [PR79173]

2023-06-16 Thread Richard Biener via Gcc-patches
> Am 16.06.2023 um 16:34 schrieb Jakub Jelinek : > > Hi! > > While the design of these builtins in clang is questionable, > rather than being say > unsigned __builtin_addc (unsigned, unsigned, bool, bool *) > so that it is clear they add two [0, 0x] range numbers > plus one [0, 1] ran

[PATCH] Remove -save-temps from tests using -flto

2023-06-18 Thread Richard Biener via Gcc-patches
The following removes -save-temps that doesn't seem to have any good reason from tests that also run with -flto added. That can cause ltrans files to race with other multilibs tested and I'm frequently seeing linker complaints that the architecture doesn't match here. I'm not sure whether the .lt

Re: [PATCH V7] VECT: Support LEN_MASK_{LOAD,STORE} ifn && optabs

2023-06-19 Thread Richard Biener via Gcc-patches
On Sun, 18 Jun 2023, ??? wrote: > Bootstrap and Regreesion on X86 passed. > Jeff and Richi approved. > > Let's wait for Richard S final approve. No need to wait. Richard. > Thanks. > > > juzhe.zh...@rivai.ai > > From: juzhe.zhong > Date: 2023-06-18 06:53 > To: gcc-patches > CC: jeffreyalaw

Re: Tiny phiprop compile time optimization

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, 19 Jun 2023, Jan Hubicka wrote: > Hi, > this patch avoids unnecessary post dominator and update_ssa in phiprop. > > Bootstrapped/regtested x86_64-linux, OK? > > gcc/ChangeLog: > > * tree-ssa-phiprop.cc (propagate_with_phi): Add > post_dominators_computed; > compute post dom

[PATCH] Fix build of aarc64

2023-06-19 Thread Richard Biener via Gcc-patches
The following fixes a reference to LOOP_VINFO_MASKS array in the aarch64 backend after my changes. Building on aarch64-linux, will push if that succeeds. Richard. * config/aarch64/aarch64.cc (aarch64_vector_costs::analyze_loop_vinfo): Fix reference to LOOP_VINFO_MASKS. --

RE: [PATCH v1] RISC-V: Fix out of range memory access when lto mode init

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, 19 Jun 2023, Li, Pan2 wrote: > Add Richard Biener for reviewing, sorry for inconvenient. > > Pan > > -Original Message- > From: Li, Pan2 > Sent: Monday, June 19, 2023 4:07 PM > To: gcc-patches@gcc.gnu.org > Cc: juzhe.zh...@rivai.ai; rdapp@gmail.com; jeffreya...@gmail.com; L

Re: Optimize std::max early

2023-06-19 Thread Richard Biener via Gcc-patches
On Sun, Jun 18, 2023 at 5:55 PM Jan Hubicka via Gcc-patches wrote: > > Hi, > we currently produce very bad code on loops using std::vector as a stack, > since > we fail to inline push_back which in turn prevents SRA and we fail to optimize > out some store-to-load pairs (PR109849). > > I looked i

Re: Do not account __builtin_unreachable guards in inliner

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, Jun 19, 2023 at 9:52 AM Jan Hubicka via Gcc-patches wrote: > > Hi, > this was suggested earlier somewhere, but I can not find the thread. > C++ has assume attribute that expands int > if (conditional) > __builtin_unreachable () > We do not want to account the conditional in inline he

[PATCH] tree-optimization/110298 - CFG cleanup and stale nb_iterations

2023-06-19 Thread Richard Biener via Gcc-patches
When unrolling we eventually kill nb_iterations info since it may refer to removed SSA names. But we do this only after cleaning up the CFG which in turn can end up accessing it. Fixed by swapping the two. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization

Re: [PATCH] RISC-V: Fix out of range memory access of machine mode table

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, 19 Jun 2023, pan2...@intel.com wrote: > From: Pan Li > > We extend the machine mode from 8 to 16 bits already. But there still > one placing missing from the tree-streamer. It has one hard coded array > for the machine code like size 256. > > In the lto pass, we memset the array by MAX_

[PATCH] debug/110295 - mixed up early/late debug for member DIEs

2023-06-19 Thread Richard Biener via Gcc-patches
When we process a scope typedef during early debug creation and we have already created a DIE for the type when the decl is TYPE_DECL_IS_STUB and this DIE is still in limbo we end up just re-parenting that type DIE instead of properly creating a DIE for the decl, eventually picking up the now compl

RE: [PATCH] Remove -save-temps from tests using -flto

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, 19 Jun 2023, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Monday, June 19, 2023 7:28 AM > > To: gcc-patches@gcc.gnu.org > > Cc: Tamar Christina > > Subject: [PATCH] Remove -save-temps from tests using -flto > > > > The following removes -save-

RE: [PATCH] Remove -save-temps from tests using -flto

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, 19 Jun 2023, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Monday, June 19, 2023 11:19 AM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org > > Subject: RE: [PATCH] Remove -save-temps from tests using -flto > > > > On Mon, 19 Jun 2023, Ta

Re: Do not account __builtin_unreachable guards in inliner

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, Jun 19, 2023 at 12:15 PM Jan Hubicka wrote: > > > On Mon, Jun 19, 2023 at 9:52 AM Jan Hubicka via Gcc-patches > > wrote: > > > > > > Hi, > > > this was suggested earlier somewhere, but I can not find the thread. > > > C++ has assume attribute that expands int > > > if (conditional) > >

Re: Do not account __builtin_unreachable guards in inliner

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, Jun 19, 2023 at 1:30 PM Richard Biener wrote: > > On Mon, Jun 19, 2023 at 12:15 PM Jan Hubicka wrote: > > > > > On Mon, Jun 19, 2023 at 9:52 AM Jan Hubicka via Gcc-patches > > > wrote: > > > > > > > > Hi, > > > > this was suggested earlier somewhere, but I can not find the thread. > > >

Re: [PATCH] Do not allow "x + 0.0" to "x" optimization with -fsignaling-nans

2023-06-19 Thread Richard Biener via Gcc-patches
On Mon, Jun 19, 2023 at 12:33 PM Toru Kisuki via Gcc-patches wrote: > > Hi, > > > With -O3 -fsignaling-nans -fno-signed-zeros, compiler should not simplify 'x > + 0.0' to 'x'. > OK if you bootstrapped / tested this change. Thanks, Richard. > GCC Bugzilla : Bug 110305 > > > gcc/ChangeLog: > > 2

[PATCH] [i386] Reject too large vectors for partial vector vectorization

2023-06-19 Thread Richard Biener via Gcc-patches
The following works around the lack of the x86 backend making the vectorizer compare the costs of the different possible vector sizes the backed advertises through the vector_modes hook. When enabling masked epilogues or main loops then this means we will select the prefered vector mode which is u

Re: Tiny phiprop compile time optimization

2023-06-19 Thread Richard Biener via Gcc-patches
> Am 19.06.2023 um 20:08 schrieb Andrew Pinski via Gcc-patches > : > > On Mon, Jun 19, 2023 at 1:32 AM Richard Biener via Gcc-patches > wrote: >> >>> On Mon, 19 Jun 2023, Jan Hubicka wrote: >>> >>> Hi, >>> this patch av

Re: [PATCH] c-family: implement -ffp-contract=on

2023-06-19 Thread Richard Biener via Gcc-patches
> Am 19.06.2023 um 19:03 schrieb Alexander Monakov : > >  > Ping. OK for trunk? Ok if the FE maintainers do not object within 48h. Thanks, Richard >> On Mon, 5 Jun 2023, Alexander Monakov wrote: >> >> Ping for the front-end maintainers' input. >> >>> On Mon, 22 May 2023, Richard Biener w

[PATCH] Improve DSE to handle stores before __builtin_unreachable ()

2023-06-20 Thread Richard Biener via Gcc-patches
DSE isn't good at identifying program points that end lifetime of variables that are not associated with virtual operands. But at least for those that end basic-blocks we can handle the simple case where this ending is in the same basic-block as the definition we want to elide. That should catch

Re: [PATCH] debug/110295 - mixed up early/late debug for member DIEs

2023-06-20 Thread Richard Biener via Gcc-patches
On Mon, 19 Jun 2023, Jason Merrill wrote: > On 6/19/23 06:15, Richard Biener wrote: > > When we process a scope typedef during early debug creation and > > we have already created a DIE for the type when the decl is > > TYPE_DECL_IS_STUB and this DIE is still in limbo we end up > > just re-parenti

Re: [PATCH] tree-optimization/110243 - kill off IVOPTs split_offset

2023-06-20 Thread Richard Biener via Gcc-patches
On Mon, 19 Jun 2023, Richard Sandiford wrote: > Jeff Law writes: > > On 6/16/23 06:34, Richard Biener via Gcc-patches wrote: > >> IVOPTs has strip_offset which suffers from the same issues regarding > >> integer overflow that split_constant_offset did but the latte

Re: [PATCH] [vect]Use intermiediate integer type for float_expr/fix_trunc_expr when direct optab is not existed.

2023-06-20 Thread Richard Biener via Gcc-patches
On Fri, Jun 2, 2023 at 3:01 AM liuhongt via Gcc-patches wrote: > > We have already use intermidate type in case WIDEN, but not for NONE, > this patch extended that. > > I didn't do that in pattern recog since we need to know whether the > stmt belongs to any slp_node to decide the vectype, the rel

Re: [PATCH] [vect]Use intermiediate integer type for float_expr/fix_trunc_expr when direct optab is not existed.

2023-06-20 Thread Richard Biener via Gcc-patches
On Tue, Jun 20, 2023 at 11:02 AM Hongtao Liu wrote: > > On Tue, Jun 20, 2023 at 4:41 PM Richard Biener > wrote: > > > > On Fri, Jun 2, 2023 at 3:01 AM liuhongt via Gcc-patches > > wrote: > > > > > > We have already use intermidate type in case WIDEN, but not for NONE, > > > this patch extended t

[PATCH] Update virtual SSA form manually where easily possible in phiprop

2023-06-20 Thread Richard Biener via Gcc-patches
This keeps virtual SSA form up-to-date in phiprop when easily possible. Only when we deal with aggregate copies the work would be too heavy-handed in general. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-phiprop.cc (phiprop_insert_phi): For simple loads

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

2023-06-20 Thread Richard Biener via Gcc-patches
On Tue, Jun 20, 2023 at 11:56 AM Prathamesh Kulkarni via Gcc-patches wrote: > > Hi Richard, > For the following reduced test-case taken from PR: > > #include "arm_sve.h" > svuint32_t l() { > alignas(16) const unsigned int lanes[4] = {0, 0, 0, 0}; > return svld1rq_u32(svptrue_b8(), lanes); > }

Re: [PATCH] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-20 Thread Richard Biener via Gcc-patches
On Tue, 20 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > This patch is apply LEN_MASK_{LOAD,STORE} into vectorizer. > I refactor gimple IR build to make codes look cleaner. > > gcc/ChangeLog: > > * internal-fn.cc (expand_partial_store_optab_fn): Add > LEN_MASK_{LOAD,S

Re: [PATCH] tree-ssa-math-opts: Small uaddc/usubc pattern matching improvement [PR79173]

2023-06-20 Thread Richard Biener via Gcc-patches
> Am 20.06.2023 um 18:46 schrieb Jakub Jelinek via Gcc-patches > : > > Hi! > > In the following testcase we fail to pattern recognize the least significant > .UADDC call. The reason is that arg3 in that case is > _3 = .ADD_OVERFLOW (...); > _2 = __imag__ _3; > _1 = _2 != 0; > arg3 = (un

Re: [PATCH] Improve DSE to handle stores before __builtin_unreachable ()

2023-06-20 Thread Richard Biener via Gcc-patches
On Tue, 20 Jun 2023, Jeff Law wrote: > > > On 6/20/23 00:59, Richard Biener via Gcc-patches wrote: > > DSE isn't good at identifying program points that end lifetime > > of variables that are not associated with virtual operands. But > > at least for those tha

[PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-21 Thread Richard Biener via Gcc-patches
The following addresses a miscompilation by RTL scheduling related to the representation of masked stores. For that we have (insn 38 35 39 3 (set (mem:V16SI (plus:DI (reg:DI 40 r12 [orig:90 _22 ] [90]) (const:DI (plus:DI (symbol_ref:DI ("b") [flags 0x2] )

Re: [PATCH] Update array address space in c_build_qualified_type

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, Jun 21, 2023 at 7:57 AM wrote: > > Hi, > > When c-typeck.cc:c_build_qualified_type builds an array type > from its element type, it does not copy the address space of > the element type to the array type itself. This is unlike > tree.cc:build_array_type_1, which explicitly does > >

Re: [PATCH] [vect]Use intermiediate integer type for float_expr/fix_trunc_expr when direct optab is not existed.

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, Jun 21, 2023 at 9:50 AM Uros Bizjak via Gcc-patches wrote: > > On Tue, Jun 20, 2023 at 6:11 PM liuhongt via Gcc-patches > wrote: > > > > I notice there's some refactor in vectorizable_conversion > > for code_helper,so I've adjusted my patch to that. > > Here's the patch I'm going to commi

Re: [PATCH V3] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-21 Thread Richard Biener via Gcc-patches
On Tue, 20 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > gcc/ChangeLog: > > * internal-fn.cc (expand_partial_store_optab_fn): Add > LEN_MASK_{LOAD,STORE} vectorizer support. > (internal_load_fn_p): Ditto. > (internal_store_fn_p): Ditto. > (inter

Re: [PATCH] tree-optimization/110243 - kill off IVOPTs split_offset

2023-06-21 Thread Richard Biener via Gcc-patches
On Tue, 20 Jun 2023, Richard Sandiford wrote: > Richard Biener writes: > > On Mon, 19 Jun 2023, Richard Sandiford wrote: > > > >> Jeff Law writes: > >> > On 6/16/23 06:34, Richard Biener via Gcc-patches wrote: > >> >> IVOPTs has strip_

Re: [PATCH] tree-optimization/110243 - kill off IVOPTs split_offset

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, 21 Jun 2023, Richard Biener wrote: > On Tue, 20 Jun 2023, Richard Sandiford wrote: > > > Richard Biener writes: > > > On Mon, 19 Jun 2023, Richard Sandiford wrote: > > > > > >> Jeff Law writes: > > >> > On 6/16/23 06:34, R

Re: [PATCH] [vect]Use intermiediate integer type for float_expr/fix_trunc_expr when direct optab is not existed.

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, Jun 21, 2023 at 11:32 AM Richard Sandiford wrote: > > Richard Sandiford writes: > > Richard Biener via Gcc-patches writes: > >> On Fri, Jun 2, 2023 at 3:01 AM liuhongt via Gcc-patches > >> wrote: > >>> > >>> We have alread

[PATCH 1/3] Hide and refactor IVOPTs strip_offset

2023-06-21 Thread Richard Biener via Gcc-patches
PR110243 shows strip_offset has some correctness issues, the following avoids using it from loop distribution which can use the more correct split_constant_offset from data-ref analysis instead. The patch then un-exports the function and refactors it to make it obvious the actual constant offset i

[PATCH 2/3] Less strip_offset in IVOPTs

2023-06-21 Thread Richard Biener via Gcc-patches
This avoids a strip_offset use in record_group_use where we know it operates on addresses. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-loop-ivopts.cc (record_group_use): Use split_constant_offset. --- gcc/tree-ssa-loop-ivopts.cc | 8 1 file ch

[PATCH 3/3] Less strip_offset in IVOPTs

2023-06-21 Thread Richard Biener via Gcc-patches
This avoids one strip_offset use in add_iv_candidate_for_use where we know it operates on a sizetype quantity. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-loop-ivopts.cc (add_iv_candidate_for_use): Use split_constant_offset for the POINTER_PLUS_EXPR cas

Re: [PATCH]: [NFC] Move can_vec_mask_load_store_p and get_len_load_store_mode from "optabs-query" into "optabs-tree"

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, 21 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Since we want both can_vec_mask_load_store_p and get_len_load_store_mode > can see "internal_fn", move these 2 functions into optabs-tree. OK. Thanks, Richard. > gcc/ChangeLog: > > * optabs-query.cc (can_vec_ma

Re: [PATCH 1/3] Hide and refactor IVOPTs strip_offset

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, 21 Jun 2023, Richard Biener wrote: > PR110243 shows strip_offset has some correctness issues, the following > avoids using it from loop distribution which can use the more correct > split_constant_offset from data-ref analysis instead. The patch then > un-exports the function and refactor

Re: [PATCH] Improve DSE to handle stores before __builtin_unreachable ()

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, 21 Jun 2023, Jeff Law wrote: > > > On 6/21/23 00:41, Richard Biener wrote: > >> I thought during the introduction of erroneous path isolation that we > >> concluded stores, calls and such had observable side effects that must be > >> preserved, even when we hit a block that leads to __bu

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-21 Thread Richard Biener via Gcc-patches
On Wed, 21 Jun 2023, Jeff Law wrote: > > > On 6/21/23 01:49, Richard Biener via Gcc-patches wrote: > > The following addresses a miscompilation by RTL scheduling related > > to the representation of masked stores. For that we have > > > > (insn 38 35 39 3 (s

Re: [PATCH] [vect]Use intermiediate integer type for float_expr/fix_trunc_expr when direct optab is not existed.

2023-06-22 Thread Richard Biener via Gcc-patches
On Wed, Jun 21, 2023 at 10:39 PM Joseph Myers wrote: > > On Wed, 21 Jun 2023, Richard Biener via Gcc-patches wrote: > > > > > int32_t x = (int32_t)0x1.0p32; > > > > int32_t y = (int32_t)(int64_t)0x1.0p32; > > > > > > > > sets x to 21474836

Re: [PATCH 2/2] cprop_hardreg: Enable propagation of the stack pointer if possible.

2023-06-22 Thread Richard Biener via Gcc-patches
On Thu, Jun 22, 2023 at 1:42 AM Thiago Jung Bauermann wrote: > > > Hello, > > Jeff Law writes: > > > On 6/19/23 22:52, Tamar Christina wrote: > > > >>> It's a bit hackish, but could we reject the stack pointer for operand1 in > >>> the > >>> stack-tie? And if we do so, does it help? > >> Yeah t

[PATCH] tree-optimization/110332 - fix ICE with phiprop

2023-06-22 Thread Richard Biener via Gcc-patches
The following fixes an ICE that occurs when we visit an edge inserted load from the code validating correctness for inserting an aggregate copy there. We can simply skip those loads here. Boostrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/110332 * tr

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

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

Re: [PATCH V4] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-22 Thread Richard Biener via Gcc-patches
On Wed, 21 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > gcc/ChangeLog: > > * internal-fn.cc (expand_partial_store_optab_fn): Adapt for > LEN_MASK_STORE. > (internal_load_fn_p): Add LEN_MASK_LOAD. > (internal_store_fn_p): Add LEN_MASK_STORE. > (

Re: [PATCH V5] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-22 Thread Richard Biener via Gcc-patches
On Thu, 22 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong OK. Thanks, Richard. > gcc/ChangeLog: > > * internal-fn.cc (expand_partial_store_optab_fn): Adapt for > LEN_MASK_STORE. > (internal_load_fn_p): Add LEN_MASK_LOAD. > (internal_store_fn_p): Add LEN_MA

[PATCH] Improve vector_vector_composition_type

2023-06-22 Thread Richard Biener via Gcc-patches
We sometimes get to ask to decompose, say V2DFmode into two halves. Currently this results in composing it from two DImode pieces instead of the obvious two DFmode pieces. The following adjusts vector_vector_composition_type for this trivial case and avoids a VIEW_CONVERT_EXPR in the initial code

[PATCH] Optimize vector codegen for invariant loads, fix SLP support

2023-06-23 Thread Richard Biener via Gcc-patches
The following avoids creating duplicate stmts for invariant loads which was necessary when the vector stmts were in a linked list. It also fixes SLP support which didn't correctly create the appropriate number of copies. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-

[PATCH][RFC] Prevent TYPE_PRECISION on VECTOR_TYPEs

2023-06-23 Thread Richard Biener via Gcc-patches
The following makes sure that using TYPE_PRECISION on VECTOR_TYPE ICEs when tree checking is enabled. This should avoid wrong-code in cases like PR110182 and instead ICE. It also introduces a TYPE_PRECISION_RAW accessor and adjusts places I found that are eligible to use that. This patch require

[PATCH 1/6] Avoid shorten_binary_op on VECTOR_TYPE

2023-06-23 Thread Richard Biener via Gcc-patches
When we disallow TYPE_PRECISION on VECTOR_TYPEs it shows that shorten_binary_op performs some checks on that that are likely harmless in the end. The following bails out early for VECTOR_TYPE operations to avoid those questionable checks. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu.

[PATCH 2/6] Fix TYPE_PRECISION use in hashable_expr_equal_p

2023-06-23 Thread Richard Biener via Gcc-patches
While the checks look unnecessary they probably are quick and thus done early. The following avoids using TYPE_PRECISION on VECTOR_TYPEs by making the code match the comment which talks about precision and signedness. An alternative would be to only retain the ERROR_MARK and TYPE_MODE checks or u

[PATCH 4/6] Fix tree_simple_nonnegative_warnv_p for VECTOR_TYPEs

2023-06-23 Thread Richard Biener via Gcc-patches
tree_simple_nonnegative_warnv_p ends up being called on VECTOR_TYPEs which I think even gets the wrong answer here for tcc_comparison since vector bools are signed. The following properly guards that with !VECTOR_TYPE_P. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu, will push after t

[PATCH 3/6] Properly guard vect_look_through_possible_promotion

2023-06-23 Thread Richard Biener via Gcc-patches
The function ends up getting called on VECTOR_TYPEs which it really isn't prepared for and with the TYPE_PRECISION checking changes will ICE. The following exits early when the type to work on isn't scalar integral. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu, will push after that f

[PATCH 6/6] Use element_precision for match.pd arith conversion optimization

2023-06-23 Thread Richard Biener via Gcc-patches
The simplification (outertype)((innertype0)a+(innertype1)b) to ((newtype)a+(newtype)b) ends up using TYPE_PRECISION to check whether it can elide a conversion but in some paths there can be VECTOR_TYPEs where this instead compares the number of lanes. The following fixes the missed optimizations an

[PATCH 5/6] Bogus and missed folding on vector compares

2023-06-23 Thread Richard Biener via Gcc-patches
fold_binary tries to transform (double)float1 CMP (double)float2 into float1 CMP float2 but ends up using TYPE_PRECISION on the argument types. For vector types that compares the number of lanes which should be always equal (so it's harmless as to not generating wrong code). The following instead

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

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

GCC 13.1.1 Status Report (2023-06-23)

2023-06-23 Thread Richard Biener via Gcc-patches
Status == The gcc-13 branch is open for regression and documentation fixes. It's time to plan for a GCC 13.2 release which should follow roughly two to three months after the .1 release. The plan is to do a release candidate for GCC 13.2 on Thursday, Jul 20th with the release following a w

[PATCH] tree-optimization/96208 - SLP of non-grouped loads

2023-06-23 Thread Richard Biener via Gcc-patches
The following extends SLP discovery to handle non-grouped loads in loop vectorization in the case the same load appears in all lanes. Code generation is adjusted to mimick what we do for the case of single element interleaving (when the load is not unit-stride) which is already handled by SLP. Th

Re: [PATCH][RFC] Prevent TYPE_PRECISION on VECTOR_TYPEs

2023-06-23 Thread Richard Biener via Gcc-patches
On Fri, 23 Jun 2023, Richard Biener wrote: > The following makes sure that using TYPE_PRECISION on VECTOR_TYPE > ICEs when tree checking is enabled. This should avoid wrong-code > in cases like PR110182 and instead ICE. > > It also introduces a TYPE_PRECISION_RAW accessor and adjusts > places I

GCC 10.4.1 Status Report (2023-06-23)

2023-06-23 Thread Richard Biener via Gcc-patches
Status == The gcc-10 branch is open for regression and documentation fixes. The last release from the branch, GCC 10.5, before it is being closed is due. There will be a release candidate next week, Friday, June 30th followed by the actual release a week later on July 7th. Please check if

Re: Do not account __builtin_unreachable guards in inliner

2023-06-23 Thread Richard Biener via Gcc-patches
On Fri, Jun 23, 2023 at 12:11 PM Jan Hubicka wrote: > > > On Mon, Jun 19, 2023 at 12:15 PM Jan Hubicka wrote: > > > > > > > On Mon, Jun 19, 2023 at 9:52 AM Jan Hubicka via Gcc-patches > > > > wrote: > > > > > > > > > > Hi, > > > > > this was suggested earlier somewhere, but I can not find the th

[PATCH] Deal with vector typed operands in conversions

2023-06-23 Thread Richard Biener via Gcc-patches
The following avoids using TYPE_PRECISION on VECTOR_TYPE when looking for bit-precision changes in vectorizable_assignment. We didn't anticipate a stmt like _21 = VIEW_CONVERT_EXPR(vect__1.7_28); and the following makes sure to handle that. Bootstrapped and tested on x86_64-unknown-linux-gnu,

[PATCH] Fix initializer_constant_valid_p_1 TYPE_PRECISION use

2023-06-23 Thread Richard Biener via Gcc-patches
initializer_constant_valid_p_1 is letting through all conversions of float vector types that have the same number of elements but that's of course not valid. The following restricts the code to scalar floating point types as was probably intended (only scalar integer types are handled as well). B

[PATCH] narrowing initializers and initializer_constant_valid_p_1

2023-06-23 Thread Richard Biener via Gcc-patches
initializer_constant_valid_p_1 attempts to handle narrowing differences and sums but fails to handle when the overall value looks like VIEW_CONVERT_EXPR(NON_LVALUE_EXPR - VEC_COND_EXPR < { 0, 0 } == { 0, 0 } , { -1, -1 } , { 0, 0 } > ) where endtype is scalar integer but value is a vector

Re: Tiny phiprop compile time optimization

2023-06-23 Thread Richard Biener via Gcc-patches
> Am 23.06.2023 um 18:10 schrieb Jan Hubicka via Gcc-patches > : > > Hi, > here is updated version with TODO_update_ssa_only_virtuals. > bootstrapped/regtested x86_64-linux. OK? Ok Richard > gcc/ChangeLog: > >* tree-ssa-phiprop.cc (propagate_with_phi): Compute post dominators on >

Re: [PATCH] DSE: Add LEN_MASK_STORE analysis into DSE

2023-06-25 Thread Richard Biener via Gcc-patches
On Fri, 23 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > gcc/ChangeLog: > > * tree-ssa-dse.cc (initialize_ao_ref_for_dse): Add LEN_MASK_STORE. > (dse_optimize_stmt): Ditto. > > --- > gcc/tree-ssa-dse.cc | 18 ++ > 1 file changed, 18 insertions(

Re: [PATCH] New finish_compare_by_pieces target hook (for x86).

2023-06-26 Thread Richard Biener via Gcc-patches
On Sun, Jun 25, 2023 at 7:39 AM Roger Sayle wrote: > > > On Tue, 13 June 2023 12:02, Richard Biener wrote: > > On Mon, Jun 12, 2023 at 4:04 PM Roger Sayle > > wrote: > > > The following simple test case, from PR 104610, shows that memcmp () > > > == 0 can result in some bizarre code sequences on

Re: [PATCH 2/3] Don't use intermiediate type for FIX_TRUNC_EXPR when ftrapping-math.

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, Jun 26, 2023 at 3:31 AM liuhongt via Gcc-patches wrote: > > > > Hmm, good question. GENERIC has a direct truncation to unsigned char > > > for example, the C standard generally says if the integral part cannot > > > be represented then the behavior is undefined. So I think we should be >

Re: [PATCH 1/3] Use cvt_op to save intermediate type operand instead of "subtle" vec_dest.

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, liuhongt wrote: > When there're multiple operands in vec_oprnds0, vec_dest will be > overwrited to vectype_out, but in multi_step_cvt case, cvt_type is > expected. It caused an ICE when verify_gimple_in_cfg. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,} and >

Re: [PATCH] GIMPLE_FOLD: Fix gimple fold for LEN_MASK_{LOAD,STORE}

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Hi, previous I made a mistake on GIMPLE_FOLD of LEN_MASK_{LOAD,STORE}. > > We should fold LEN_MASK_{LOAD,STORE} (bias+len) == vf (nunits instead of > bytesize) && mask = all trues mask > > into: >MEM_REF [...]. > >

Re: [PATCH V2] DSE: Add LEN_MASK_STORE analysis into DSE

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > gcc/ChangeLog: > > * tree-ssa-dse.cc (initialize_ao_ref_for_dse): Add LEN_MASK_STORE. > (dse_optimize_stmt): Ditto. > > --- > gcc/tree-ssa-dse.cc | 27 +++ > 1 file changed, 27 in

Re: [PATCH] SCCVN: Fix repeating variable name "len"

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Line 3292: has variable name "len": tree mask = NULL_TREE, len = NULL_TREE, > bias = NULL_TREE; > Line 3349: has variable name "len": HOST_WIDE_INT start = 0, len = 0; > > Since they are never used simultaneously, such i

Re: [PATCH] SSCV: Add LEN_MASK_STORE into SCCVN

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Hi, this patch is to add LEN_MASK_STORE into SCCVN. > > LEN_MASK_STORE is predicated by both len and mask together. > My understanding is that LEN_MASK_STORE has same rhs_off and offset as > MASK_STORE. > The size = MIN

Re: [PATCH V3] DSE: Add LEN_MASK_STORE analysis into DSE and fix LEN_STORE

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Hi, Richi. > > This patch is adding LEN_MASK_STORE into DSE. > > My understanding is LEN_MASK_STORE is predicated by mask and len. > No matter len is constant or not, the ao_ref should be the same as MASK_STORE. > > Whe

Re: [PATCH V2] GIMPLE_FOLD: Fix gimple fold for LEN_{MASK}_{LOAD,STORE}

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > Hi, previous I made a mistake on GIMPLE_FOLD of LEN_MASK_{LOAD,STORE}. > > We should fold LEN_MASK_{LOAD,STORE} (bias+len) == vf (nunits instead of > bytesize) && mask = all trues mask > > into: >MEM_REF [...]. > >

Re: [PATCH][RFC] middle-end/110237 - wrong MEM_ATTRs for partial loads/stores

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, Hongtao Liu wrote: > On Wed, Jun 21, 2023 at 3:49?PM Richard Biener via Gcc-patches > wrote: > > > > The following addresses a miscompilation by RTL scheduling related > > to the representation of masked stores. For that we have > > > &

Re: [PATCH] RISC-V: Remove redundant vcond patterns

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, 26 Jun 2023, Juzhe-Zhong wrote: > Previously, Richi has suggested that vcond patterns are only needed when > target > support comparison + select consuming 1 instruction. > > Now, I do the experiments on removing those "vcond" patterns, it works > perfectly. > > All testcases PASS. >

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

2023-06-26 Thread Richard Biener via Gcc-patches
On Mon, Jun 26, 2023 at 8:24 AM Tejas Belagod via Gcc-patches wrote: > > Hi, > > Packed Boolean Vectors > -- > > I'd like to propose a feature addition to GNU Vector extensions to add packed > boolean vectors (PBV). This has been discussed in the past here[1] and a > variant

<    3   4   5   6   7   8   9   10   11   12   >