Re: [PATCH] ipa-cp: Fix assert triggering with -fno-toplevel-reorder (PR 106260)

2022-07-13 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 11:06 PM Martin Jambor wrote: > > Hi, > > with -fno-toplevel-reorder (and -fwhole-program), there apparently can > be local functions without any callers. Did you check why? Can't we fix that? > This is something that IPA-CP > does not like because its propagation verif

Re: [x86_64 PATCH] Improved Scalar-To-Vector (STV) support for TImode to V1TImode.

2022-07-14 Thread Richard Biener via Gcc-patches
On Thu, Jul 14, 2022 at 7:32 AM Roger Sayle wrote: > > > On Mon, Jul 11, 2022, H.J. Lu wrote: > > On Sun, Jul 10, 2022 at 2:38 PM Roger Sayle > > wrote: > > > Hi HJ, > > > > > > I believe this should now be handled by the post-reload (CSE) pass. > > > Consider the simple test case: > > > > > > _

Re: [PATCH] [RFC]Support vectorization for Complex type.

2022-07-14 Thread Richard Biener via Gcc-patches
; > > > > > On Mon, Jul 11, 2022 at 7:47 PM Richard Biener via Gcc-patches > > > > wrote: > > > > > > > > > > On Mon, Jul 11, 2022 at 5:44 AM liuhongt > > > > > wrote: > > > > > > > > > >

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-14 Thread Richard Biener via Gcc-patches
On Thu, Jul 14, 2022 at 9:55 AM Prathamesh Kulkarni wrote: > > On Wed, 13 Jul 2022 at 12:22, Richard Biener > wrote: > > > > On Tue, Jul 12, 2022 at 9:12 PM Prathamesh Kulkarni via Gcc-patches > > wrote: > > > > > > Hi Richard, > > > For the following test: > > > > > > svint32_t f2(int a, int b

Re: [PATCH] Fix ICE on view conversion between struct and integer

2022-07-14 Thread Richard Biener via Gcc-patches
On Thu, Jul 14, 2022 at 10:20 AM Eric Botcazou via Gcc-patches wrote: > > Hi, > > you can build a view conversion between pretty much anything in Ada including > between types with different sizes, although the compiler warns in this case > and gigi pads the smaller type to end up with the same si

Re: [PATCH] lto-plugin: use -pthread only for detected targets

2022-07-14 Thread Richard Biener via Gcc-patches
On Thu, Jul 14, 2022 at 12:03 PM Martin Liška wrote: > > On 7/13/22 14:15, Richard Biener wrote: > > Didn't we have it that way and not work? IIRC LDFLAGS is only > > used during configure link tests and _not_ substituted? > > You are right. > > There's a proper fix that utilizes AM_CONDITIONAL a

Re: [PATCH] lto-plugin: use -pthread only for detected targets

2022-07-14 Thread Richard Biener via Gcc-patches
On Thu, Jul 14, 2022 at 1:13 PM Martin Liška wrote: > > On 7/14/22 12:10, Richard Biener wrote: > > On Thu, Jul 14, 2022 at 12:03 PM Martin Liška wrote: > >> > >> On 7/13/22 14:15, Richard Biener wrote: > >>> Didn't we have it that way and not work? IIRC LDFLAGS is only > >>> used during configu

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-17 Thread Richard Biener via Gcc-patches
On Fri, Jul 15, 2022 at 3:49 PM Prathamesh Kulkarni wrote: > > On Thu, 14 Jul 2022 at 17:22, Richard Sandiford > wrote: > > > > Richard Biener writes: > > > On Thu, Jul 14, 2022 at 9:55 AM Prathamesh Kulkarni > > > wrote: > > >> > > >> On Wed, 13 Jul 2022 at 12:22, Richard Biener > > >> wrote

Re: [middle-end PATCH] PR c/106264: Silence warnings from __builtin_modf et al.

2022-07-17 Thread Richard Biener via Gcc-patches
On Sat, Jul 16, 2022 at 2:54 PM Roger Sayle wrote: > > > This middle-end patch resolves PR c/106264 which is a spurious warning > regression caused by the tree-level expansion of modf, frexp and remquo > producing "expression has no-effect" when the built-in function's result > is ignored. When t

[PATCH] Improve common reduction vs builtin code generation in loop distribution

2022-07-18 Thread Richard Biener via Gcc-patches
loop distribution currently cannot handle the situation when the last partition is a builtin but there's a common reduction in all partitions (like the final IV value). The following lifts this restriction by making the last non-builtin partition provide the definitions for the loop-closed PHI nod

[PATCH] Fix builtin vs non-builtin partition merge in loop distribution

2022-07-18 Thread Richard Biener via Gcc-patches
When r7-6373-g40b6bff965d004 fixed a costing issue it failed to make the logic symmetric which means that we now fuse normal vs. builtin when the cost model says so but we don't fuse builtin vs. normal. The following fixes that, also allowing the cost model to decide to fuse two builtin partitions

Re: [PATCH] match.pd: Add new abs pattern [PR94290]

2022-07-18 Thread Richard Biener via Gcc-patches
On Mon, Jul 18, 2022 at 7:31 PM Sam Feifer via Gcc-patches wrote: > > Just realized I had mixed up the 9 and the 2 when labelling the patch. This > patch is referring to pr94920 not pr94290. Attached is a fixed patch file. > Sorry for any confusion. Can you put the patterns somewhere related? Th

[PATCH] lto/106334 - relax assert during WPA tree merging

2022-07-19 Thread Richard Biener via Gcc-patches
The dwarf2out map of tree to symbol + offset is populated too early when streaming in trees so that when WPA tree merging decides to recycle them the mapping prevails and if we are unlucky the same address is used for another tree with a symbol + offset DIE to record. The following mitigates the r

[PATCH] middle-end/106331 - fix mem attributes for string op arguments

2022-07-19 Thread Richard Biener via Gcc-patches
get_memory_rtx tries hard to come up with a MEM_EXPR to record in the memory attributes but in the last fallback fails to properly account for an unknown offset and thus, as visible in this testcase, incorrect alignment computed from set_mem_attributes. The following rectifies both parts. Bootstr

Re: [PATCH 2/3] tree-cfg: do not duplicate returns_twice calls

2022-07-19 Thread Richard Biener via Gcc-patches
On Thu, Jul 14, 2022 at 10:12 PM Alexander Monakov wrote: > > > On Thu, 14 Jul 2022, Richard Biener wrote: > > > Indeed. Guess that's what __builtin_setjmp[_receiver] for SJLJ_EH got > > "right". > > > > When copying a block we do not copy labels so any "jumps" remain to the > > original > > bl

Re: [PATCH V2] [RFC]Support vectorization for Complex type.

2022-07-19 Thread Richard Biener via Gcc-patches
On Mon, Jul 18, 2022 at 4:31 AM liuhongt wrote: > > V2 update: >Handle VMAT_ELEMENTWISE, VMAT_CONTIGUOUS_PERMUTE, VMAT_STRIDED_SLP, >VMAT_CONTIGUOUS_REVERSE, VMAT_CONTIGUOUS_DOWN for complex type. > > I've run SPECspeed@2017 627.cam4_s, there's some vectorization cases, > but no big perfor

Re: [PATCH] doc: Clarify FENV_ACCESS pragma semantics WRT `-ftrapping-math'

2022-07-20 Thread Richard Biener via Gcc-patches
On Tue, Jul 19, 2022 at 2:24 PM Maciej W. Rozycki wrote: > > Our documentation indicates that it is the `-frounding-math' invocation > option that controls whether we respect what the FENV_ACCESS pragma > would imply, should we implement it, regarding the floating point > environment. It is only

Re: [committed] .gitignore: do not ignore config.h

2022-07-20 Thread Richard Biener via Gcc-patches
On Tue, Jul 19, 2022 at 4:09 PM Alexander Monakov via Gcc-patches wrote: > > GCC does not support in-tree builds at the moment, so .gitignore > concealing artifacts of accidental in-tree ./configure run may cause > confusion. Un-ignore config.h, which is known to break the build. OK > ChangeLog:

Re: [PATCH 1/2] Remove unused remove_node_from_expr_list

2022-07-20 Thread Richard Biener via Gcc-patches
On Tue, Jul 19, 2022 at 5:16 PM Alexander Monakov via Gcc-patches wrote: > > This function remains unused since remove_node_from_insn_list was cloned > from it. OK. > gcc/ChangeLog: > > * rtl.h (remove_node_from_expr_list): Remove declaration. > * rtlanal.cc (remove_node_from_exp

Re: [PATCH 2/2] Avoid registering __builtin_setjmp_receiver label twice [PR101347]

2022-07-20 Thread Richard Biener via Gcc-patches
On Tue, Jul 19, 2022 at 5:17 PM Alexander Monakov via Gcc-patches wrote: > > The testcase in the PR demonstrates how it is possible for one > __builtin_setjmp_receiver label to appear in > nonlocal_goto_handler_labels list twice (after the block with > __builtin_setjmp_setup referring to it was du

Re: [PATCH] Move pass_cse_sincos after vectorizer.

2022-07-20 Thread Richard Biener via Gcc-patches
On Wed, Jul 20, 2022 at 4:20 AM liuhongt wrote: > > __builtin_cexpi can't be vectorized since there's gap between it and > vectorized sincos version(In libmvec, it passes a double and two > double pointer and returns nothing.) And it will lose some > vectorization opportunity if sin & cos are opti

gcc-patches@gcc.gnu.org

2022-07-20 Thread Richard Biener via Gcc-patches
On Wed, Jul 20, 2022 at 4:46 AM liuhongt wrote: > > > My original comments still stand (it feels like this should be more > > generic). > > Can we go the way lowering complex loads/stores first? A large part > > of the testcases > > added by the patch should pass after that. > > This is the patc

[PATCH] Improve SLP codegen, avoiding unnecessary TREE_ADDRESSABLE

2022-07-20 Thread Richard Biener via Gcc-patches
The following adjusts vectorizer code generation to avoid splitting out address increments for invariant addresses which causes objects to get TREE_ADDRESSABLE when not necessary. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-vect-data-refs.cc (bump_vector_ptr): Retu

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-20 Thread Richard Biener via Gcc-patches
On Wed, Jul 20, 2022 at 5:36 PM Prathamesh Kulkarni wrote: > > On Mon, 18 Jul 2022 at 11:57, Richard Biener > wrote: > > > > On Fri, Jul 15, 2022 at 3:49 PM Prathamesh Kulkarni > > wrote: > > > > > > On Thu, 14 Jul 2022 at 17:22, Richard Sandiford > > > wrote: > > > > > > > > Richard Biener w

[PATCH] Add alias disambiguation for vectorizer load/store IFNs

2022-07-21 Thread Richard Biener via Gcc-patches
The following adds support for MASK_STORE, MASK_LOAD and friends to call_may_clobber_ref_p and ref_maybe_used_by_call_p. Since they all use a special argument to specify TBAA they are not really suited for fnspec handling thus the manual support. Bootstrapped and tested on x86_64-unknown-linux-gn

[PATCH] Teach VN about masked/len stores

2022-07-21 Thread Richard Biener via Gcc-patches
The following teaches VN to handle reads from .MASK_STORE and .LEN_STORE. For this push_partial_def is extended first for convenience so we don't have to handle the full def case in the caller (possibly other paths can be simplified then). Also the partial definition stored value can have an offs

[PATCH] tree-optimization/106365 - DSE of LEN_STORE and MASK_STORE

2022-07-21 Thread Richard Biener via Gcc-patches
The following enhances DSE to handle LEN_STORE (optimally) and MASK_STORE (conservatively). Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Kewen is testing on powerpc. Handling MASK_STORE_LANES in a similar way to MASK_STORE is probably possible but I couldn't figure a way to gene

Re: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream

2022-07-21 Thread Richard Biener via Gcc-patches
On Mon, Jul 11, 2022 at 10:05 PM Martin Liška wrote: > > I'm going to push the following cherry-pick which fixes libasan > build with top-of-tree glibc. Can you also push this to active branches please? > Martin > > 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include > to reso

Re: libgo patch committed: Don't include in sysinfo.c

2022-07-21 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 6:03 PM Ian Lance Taylor via Gcc-patches wrote: > > This libgo patch stops including when building > gen-sysinfo.go. Removing this doesn't change anything at least with > glibc 2.33. The include was added in https://go.dev/cl/6100049 but > it's not clear why. This shoul

[PATCH] tree-optimization/106379 - add missing ~(a ^ b) folding for _Bool

2022-07-21 Thread Richard Biener via Gcc-patches
The following makes sure to fold ~(a ^ b) to a == b for truth values (but not vectors, we'd have to check for vector support of equality). That turns the PR106379 testcase into a ranger one. Note that while we arrive at ~(a ^ b) in a convoluted way from original !a == !b one can eventually write

[PATCH] tree-optimization/106387 - properly create SSA name for realigned load

2022-07-22 Thread Richard Biener via Gcc-patches
The following fixes an oversight triggering after the recent change to bump_vector_ptr. Bootstrapped on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/106387 * tree-vect-stmts.cc (vectorizable_load): Use make_ssa_name if ptr is not an SSA name. --- gcc/tree-vect-s

[PATCH] tree-optimization/106403 - fix ICE with VN of .STORE_LANES

2022-07-22 Thread Richard Biener via Gcc-patches
While .STORE_LANES is not supported by the recent VN patch we were still accessing the stored value and valueizing it - but internal_fn_stored_value_index does not support .STORE_LANES and we failed to honor that case. Fixed by simply moving the affected code below the check for the actual support

[PATCH] tree-optimization/106397 - array prefetch and LC SSA

2022-07-22 Thread Richard Biener via Gcc-patches
The following fixes maintaining LC SSA when array prefetch inserts mfence instructions on loop exits that do not use memory. It also fixes the latent issue that it might split exit edges for this which will break LC SSA for non-virtuals as well. It should also make the process cheaper by accumula

Re: [PATCH] libsanitizer: Fix Solaris 11.3 compilation [PR105531]

2022-07-22 Thread Richard Biener via Gcc-patches
On Fri, Jul 22, 2022 at 11:29 AM Rainer Orth wrote: > > The libsanitizer build has been broken on Solaris 11.3 by the latest > import. An upstream patch to fix this has now been committed: > > [sanitizer_common] Support Solaris < 11.4 in GetStaticTlsBoundary > https://reviews.llvm

Re: [PATCH] graphds: Fix description of SCC algorithm

2022-07-22 Thread Richard Biener via Gcc-patches
On Fri, Jul 22, 2022 at 12:10 PM Richard Sandiford via Gcc-patches wrote: > > graphds_scc says that it uses Tarjan's algorithm, but it looks like > it uses Kosaraju's algorithm instead (dfs one way followed by dfs > the other way). > > OK to install? OK. > Richard > > > gcc/ > * graphds.

Re: [PATCH] tree-optimization/106379 - add missing ~(a ^ b) folding for _Bool

2022-07-22 Thread Richard Biener via Gcc-patches
> Am 22.07.2022 um 22:17 schrieb H.J. Lu via Gcc-patches > : > > On Thu, Jul 21, 2022 at 4:24 AM Richard Biener via Gcc-patches > wrote: >> >> The following makes sure to fold ~(a ^ b) to a == b for truth >> values (but not vectors, we'd have to c

[PATCH] middle-end/106414 - fix mistake in ~(x ^ y) -> x == y pattern

2022-07-25 Thread Richard Biener via Gcc-patches
When compares are integer typed the inversion with ~ isn't properly preserved by the equality comparison even when converting the result properly. The following fixes this by restricting the input precisions accordingly. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. PR m

Re: [PATCH] tree-optimization/106379 - add missing ~(a ^ b) folding for _Bool

2022-07-25 Thread Richard Biener via Gcc-patches
On Mon, 25 Jul 2022, H.J. Lu wrote: > On Fri, Jul 22, 2022 at 11:10 PM Richard Biener via Gcc-patches > wrote: > > > > > > > > > Am 22.07.2022 um 22:17 schrieb H.J. Lu via Gcc-patches > > > : > > > > > > On Thu, Jul 21,

[PATCH] tree-optimization/106189 - avoid division by zero exception

2022-07-25 Thread Richard Biener via Gcc-patches
The diagnostic code can end up with zero sized array elements with T[][0] and the wide-int code nicely avoids exceptions when dividing by zero in one codepath but not in another. The following fixes the exception by using wide-int in both paths. Bootstrapped and tested on x86_64-unknown-linux-gnu

Re: [PING][PATCH] c: Handle initializations of opaque types [PR106016] (need review of expr.cc hunk)

2022-07-25 Thread Richard Biener via Gcc-patches
On Tue, Jul 26, 2022 at 12:46 AM Peter Bergner via Gcc-patches wrote: > > I'd like to ping the following patch. Segher has approved the > test case change, so I just need a review for the expr.cc change. > > Peter > > > > Message-ID: <009c391d-3994-8755-0d22-9e80faf91...@linux.ibm.com> > Date: Fr

gcc-patches@gcc.gnu.org

2022-07-26 Thread Richard Biener via Gcc-patches
When the first pointer happens to be a pointer to a STRING_CST we give up too early since the 2nd pointer handling could still end up with a DECL for example which can disambiguate against a STRING_CST just fine. Boostrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-alias

[PATCH] tree-optimization/105142 - improve maybe_fold_comparisons_from_match_pd fix

2022-07-26 Thread Richard Biener via Gcc-patches
The following improves on the fix for PR105142 which restricted the expression lookup used for maybe_fold_comparisons_from_match_pd to avoid picking up flow-sensitive info for use in places where guarding conditions do not hold. Instead of not allowing to expand SSA definitions there the following

[PATCH 1/2] tree-optimization/105142 - improve maybe_fold_comparisons_from_match_pd fix

2022-07-26 Thread Richard Biener via Gcc-patches
The following improves on the fix for PR105142 which restricted the expression lookup used for maybe_fold_comparisons_from_match_pd to avoid picking up flow-sensitive info for use in places where guarding conditions do not hold. Instead of not allowing to expand SSA definitions there the following

[PATCH 2/2] tree-optimization/105651 - simplify address range overlap check

2022-07-26 Thread Richard Biener via Gcc-patches
The following adds a pattern for ifcombine to match an address overlap check and use alias analysis to decide overlap at compile-time. This happens with code generated from std::string as shown in the PR even if meanwhile the trunk generated code causes the pattern to no longer match. Bootstrappe

Re: [PATCH] c-family: Honor -Wno-init-self for cv-qual vars [PR102633]

2022-07-26 Thread Richard Biener via Gcc-patches
On Tue, 26 Jul 2022, Marek Polacek wrote: > Since r11-5188-g32934a4f45a721, we drop qualifiers during l-to-r > conversion by creating a NOP_EXPR. For e.g. > > const int i = i; > > that means that the DECL_INITIAL is '(int) i' and not 'i' anymore. > Consequently, we don't suppress_warning here

Re: [PATCH 1/1] Fix bit-position comparison

2022-07-26 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, juzhe.zh...@rivai.ai wrote: > From: zhongjuzhe > > gcc/ChangeLog: > > * expr.cc (expand_assignment): Change GET_MODE_PRECISION to > GET_MODE_BITSIZE > > --- > gcc/expr.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/expr.cc b/gcc/

Re: Re: [PATCH 1/1] Fix bit-position comparison

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, juzhe.zh...@rivai.ai wrote: > Thank you so much for the fast reply. Ok, it is true that I didn't think > about it carefully. Can you help me with the following the issue? > > For RVV (RISC-V 'V' Extension), we have full vector type 'vint8m1_t' (LMUL = > 1) and fractional ve

Re: Re: [PATCH 1/1] Fix bit-position comparison

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, juzhe.zh...@rivai.ai wrote: > Let's take look at these 2 cases: https://godbolt.org/z/zP16frPnb. In > RVV, we have vle8 and vsetvli to specify loading vint8mf2 (vsetvli a1, > zero + vle8.v). You can see it in foo function. In this case we don't > need to confuse compiler

Re: [PATCH] match.pd: Add new division pattern [PR104992]

2022-07-27 Thread Richard Biener via Gcc-patches
On Tue, Jul 26, 2022 at 4:32 PM Sam Feifer via Gcc-patches wrote: > > > > > int f(_Complex int x, _Complex int y) > > { > > return x == x / y * y; > > } > > > > After some research about mod with complex types, I found that the binary > mod operation does not work with complex types. If so, the

Re: [PATCH] opts: Add an assertion to help static analyzers [PR106332]

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, Jakub Jelinek wrote: > Hi! > > This function would have UB if called with empty candidates vector > (accessing p[-1] where p is malloc (0) result). > As analyzed in the PR, we never call it with empty vector, so this just > adds an assertion to make it clear. > > Bootstrappe

Re: [PATCH] gimple, internal-fn: Add IFN_TRAP and use it for __builtin_unreachable [PR106099]

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, Jakub Jelinek wrote: > Hi! > > __builtin_unreachable and __ubsan_handle_builtin_unreachable don't > use vops, they are marked const/leaf/noreturn/nothrow/cold. > But __builtin_trap uses vops, isn't const, just leaf/noreturn/nothrow/cold. > This is I believe so that when users

Re: [PATCH] cgraphunit: Don't emit asm thunks for -dx [PR106261]

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, Jakub Jelinek wrote: > Hi! > > When -dx option is used (didn't know we have it and no idea what is it > useful for), we just expand functions to RTL and then omit all further > RTL passes, so the normal functions aren't actually emitted into assembly, > just variables. > The

[PATCH] Fix Rogers e-mail in MAINTAINERS

2022-07-27 Thread Richard Biener via Gcc-patches
I've made the mistake of cut&pasting the bouncing address at least twice. Pushed. * MAINTAINERS (Roger Sayle): Update e-mail address. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 46c9e48a497..7408396471f 100644 ---

Re: [PATCH] gimple, internal-fn: Add IFN_TRAP and use it for __builtin_unreachable [PR106099]

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, Jakub Jelinek wrote: > On Wed, Jul 27, 2022 at 09:33:47AM +, Richard Biener wrote: > > > __builtin_unreachable and __ubsan_handle_builtin_unreachable don't > > > use vops, they are marked const/leaf/noreturn/nothrow/cold. > > > But __builtin_trap uses vops, isn't const, ju

GCC 12.1.1 Status Report (2022-07-27)

2022-07-27 Thread Richard Biener via Gcc-patches
Status == The gcc-12 branch is open for regression and documentation fixes. It is time for a GCC 12.2 release, we are comparatively late with it already. The plan is to create a GCC 12.2 release candidate on August 12th which should give plenty of time to backport or implement important re

Re: [PATCH] gimple, internal-fn: Add IFN_TRAP and use it for __builtin_unreachable [PR106099]

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, Jakub Jelinek wrote: > On Wed, Jul 27, 2022 at 10:09:34AM +, Richard Biener wrote: > > > We chose to sanitize not just explicit user __builtin_unreachable calls, > > > but also the internally generated __builtin_unreachable calls (with the > > > one exception of fall throu

RE: [PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Tuesday, July 12, 2022 2:19 PM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd ; ja...@redhat.com > > Subject: RE: [PATCH 2/2]middle-end: Support recognition of three-way > >

Re: [RFC] Teach vectorizer to deal with bitfield reads

2022-07-27 Thread Richard Biener via Gcc-patches
On Tue, 26 Jul 2022, Andre Vieira (lists) wrote: > Hi, > > This is a RFC for my prototype for bitfield read vectorization. This patch > enables bit-field read vectorization by removing the rejection of bit-field > read's during DR analysis and by adding two vect patterns. The first one > transfor

Re: Re: [PATCH 1/1] Fix bit-position comparison

2022-07-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Jul 2022, juzhe.zh...@rivai.ai wrote: > For vint8m1_t: >VECTOR_MODES_WITH_PREFIX (VNx, INT, 16, 0) > ADJUST_NUNITS (VNx16QI, riscv_vector_chunks * 8); > ADJUST_BYTES (VNx16QI, riscv_vector_chunks * 8); > For vint8mf2_t: >VECTOR_MODES_WITH_PREFIX (VNx, INT, 8, 0) > ADJUST_NUNIT

Re: [PATCH] match.pd: Add new division pattern [PR104992]

2022-07-28 Thread Richard Biener via Gcc-patches
On Wed, Jul 27, 2022 at 9:57 PM Sam Feifer wrote: > > >> _Complex int are strange beasts, I'd simply avoid the transform for them. >> > > I added to the match.pd rule to not simplify if the operands are complex. > There is now a test case for complex types to make sure they do not simplify. > I

Re: [GCC13][Patch][V2][1/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-07-28 Thread Richard Biener via Gcc-patches
On Tue, 19 Jul 2022, Qing Zhao wrote: > From 3854004802b8e2f132ebf218fc35a632f5e80c6a Mon Sep 17 00:00:00 2001 > From: Qing Zhao > Date: Mon, 18 Jul 2022 17:04:12 + > Subject: [PATCH 1/2] Add a new option -fstrict-flex-array[=n] and new > attribute strict_flex_array > > Add the following new

Re: [GCC13][Patch][V2][2/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-07-28 Thread Richard Biener via Gcc-patches
On Tue, 19 Jul 2022, Qing Zhao wrote: > From a09f39ded462611286a44d9e8273de8342673ba2 Mon Sep 17 00:00:00 2001 > From: Qing Zhao > Date: Mon, 18 Jul 2022 18:12:26 + > Subject: [PATCH 2/2] Use new flag DECL_NOT_FLEXARRAY in __builtin_object_size > [PR101836] > > Use new flag DECL_NOT_FLEXARRA

Re: [PATCH] testsuite: Add extra RISC-V options so that -fprefetch-loop-arrays works

2022-07-28 Thread Richard Biener via Gcc-patches
On Thu, 28 Jul 2022, jiawei wrote: > This patch adds the additional options on RISC-V target. > "-fprefetch-loop-arrays" option needs enable prefetch instruction, > for RISC-V that contained in "zicbop" extension. > Use "-march" with "zicbop" will enable this feature. OK. Note -fprefetch-loop-ar

[PATCH] middle-end/106457 - improve array_at_struct_end_p for array objects

2022-07-28 Thread Richard Biener via Gcc-patches
Array references to array objects are never at struct end. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR middle-end/106457 * tree.cc (array_at_struct_end_p): Handle array objects specially. --- gcc/tree.cc | 4 1 file changed, 4 insertions(+) diff

Re: [GCC13][Patch][V2][1/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-07-28 Thread Richard Biener via Gcc-patches
On Thu, 28 Jul 2022, Kees Cook wrote: > On Thu, Jul 28, 2022 at 07:26:57AM +, Richard Biener wrote: > > On Tue, 19 Jul 2022, Qing Zhao wrote: > > > [...] > > > +@cindex @code{strict_flex_array} variable attribute > > > +@item strict_flex_array (@var{level}) > > > +The @code{strict_flex_array}

[PATCH] Avoid vect_get_vector_types_for_stmt

2022-07-28 Thread Richard Biener via Gcc-patches
This replaces vect_get_vector_types_for_stmt with get_vectype_for_scalar_type in vect_recog_bool_pattern. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-vect-patterns.cc (vect_recog_bool_pattern): Use get_vectype_for_scalar_type instead of vect_get_vec

[PATCH] Use CONVERT_EXPR_CODE_P

2022-07-28 Thread Richard Biener via Gcc-patches
Bootstrapped on x86_64-unknown-linux-gnu, pushed. * gimple-ssa-warn-restrict.cc (builtin_memref::set_base_and_offset): Use CONVERT_EXPR_CODE_P. --- gcc/gimple-ssa-warn-restrict.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/gimple-ssa-warn-restrict.cc

Re: cselib: add function to check if SET is redundant [PR106187]

2022-07-29 Thread Richard Biener via Gcc-patches
On Thu, Jul 28, 2022 at 6:46 PM Richard Earnshaw wrote: > > [resend with correct subject line] > > A SET operation that writes memory may have the same value as an earlier > store but if the alias sets of the new and earlier store do not conflict > then the set is not truly redundant. This can ha

[PATCH] tree-optimization/106422 - verify block copying in forward threading

2022-07-29 Thread Richard Biener via Gcc-patches
The forward threader failed to check whether it can actually duplicate blocks. The following adds this in a similar place the backwards threader performs this check. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/106422 * tree-ssa-threadupdate.c

[PATCH] tree-optimization/105679 - disable backward threading of unlikely entry

2022-07-29 Thread Richard Biener via Gcc-patches
The following makes the backward threader reject threads whose entry edge is probably never executed according to the profile. That in particular, for the testcase, avoids threading the irq == 1 check on the path where irq > 31, thereby avoiding spurious -Warray-bounds diagnostics if (irq_1(D)

Re: [RFC] Teach vectorizer to deal with bitfield reads

2022-07-29 Thread Richard Biener via Gcc-patches
On Fri, 29 Jul 2022, Andre Vieira (lists) wrote: > Hi Richard, > > Thanks for the review, I don't completely understand all of the below, so I > added some extra questions to help me understand :) > > On 27/07/2022 12:37, Richard Biener wrote: > > On Tue, 26 Jul 2022, Andre Vieira (lists) wrote:

Re: cselib: add function to check if SET is redundant [PR106187]

2022-07-29 Thread Richard Biener via Gcc-patches
On Fri, Jul 29, 2022 at 11:52 AM Richard Earnshaw wrote: > > > > On 29/07/2022 08:06, Richard Biener via Gcc-patches wrote: > > On Thu, Jul 28, 2022 at 6:46 PM Richard Earnshaw > > wrote: > >> > >> [resend with correct subject line] > >> > &

Re: [RFC] Teach vectorizer to deal with bitfield reads

2022-07-29 Thread Richard Biener via Gcc-patches
On Fri, 29 Jul 2022, Jakub Jelinek wrote: > On Fri, Jul 29, 2022 at 09:57:29AM +0100, Andre Vieira (lists) via > Gcc-patches wrote: > > The 'only on the vectorized code path' remains the same though as vect_recog > > also only happens on the vectorized code path right? > > if conversion (in some

Re: [PATCH] tree-optimization/105679 - disable backward threading of unlikely entry

2022-07-29 Thread Richard Biener via Gcc-patches
On Fri, 29 Jul 2022, Aldy Hernandez wrote: > On Fri, Jul 29, 2022 at 11:02 AM Richard Biener wrote: > > > > The following makes the backward threader reject threads whose entry > > edge is probably never executed according to the profile. That in > > particular, for the testcase, avoids threadin

Re: [GCC13][Patch][V2][2/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-08-01 Thread Richard Biener via Gcc-patches
On Fri, 29 Jul 2022, Qing Zhao wrote: > > > > On Jul 28, 2022, at 3:28 AM, Richard Biener wrote: > > > > On Tue, 19 Jul 2022, Qing Zhao wrote: > > > >> From a09f39ded462611286a44d9e8273de8342673ba2 Mon Sep 17 00:00:00 2001 > >> From: Qing Zhao > >> Date: Mon, 18 Jul 2022 18:12:26 + > >>

Re: [GCC13][Patch][V2][1/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-08-01 Thread Richard Biener via Gcc-patches
On Fri, 29 Jul 2022, Qing Zhao wrote: > Hi, Richard, > > Thanks a lot for your comments and suggestions. (And sorry for my late reply). > > > On Jul 28, 2022, at 3:26 AM, Richard Biener wrote: > > > > On Tue, 19 Jul 2022, Qing Zhao wrote: > > > >> From 3854004802b8e2f132ebf218fc35a632f5e80c6a

Re: [PATCH] tree-optimization/105679 - disable backward threading of unlikely entry

2022-08-01 Thread Richard Biener via Gcc-patches
On Sun, 31 Jul 2022, Iain Sandoe wrote: > Hi Richi, > > > On 29 Jul 2022, at 09:54, Richard Biener via Gcc-patches > > wrote: > > > > The following makes the backward threader reject threads whose entry > > edge is probably never executed according to the p

Re: [RFC] Teach vectorizer to deal with bitfield reads

2022-08-01 Thread Richard Biener via Gcc-patches
On Mon, 1 Aug 2022, Andre Vieira (lists) wrote: > > On 29/07/2022 11:52, Richard Biener wrote: > > On Fri, 29 Jul 2022, Jakub Jelinek wrote: > > > >> On Fri, Jul 29, 2022 at 09:57:29AM +0100, Andre Vieira (lists) via > >> Gcc-patches wrote: > >>> The 'only on the vectorized code path' remains the

[PATCH] tree-optimization/106495 - avoid threading to possibly never executed edge

2022-08-01 Thread Richard Biener via Gcc-patches
The following builds upon the logic of the PR105679 fix by avoiding to thread to a known edge that is predicted as probably never executed. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. PR tree-optimization/106495 * tree-ssa-threadbackward.cc (back_threade

[PATCH] lto/106334 - fix previous fix wrt -flto-partition=none

2022-08-01 Thread Richard Biener via Gcc-patches
This adjusts the assert guard to include -flto-partition=none which behaves as WPA. Bootstrapped & tested on x86_64-unknown-linux-gnu, pushed. PR lto/106334 * dwarf2out.cc (dwarf2out_register_external_die): Adjust assert. --- gcc/dwarf2out.cc | 11 ++- 1 file chan

[PATCH] tree-optimization/106498 - reduce SSA updates in autopar

2022-08-01 Thread Richard Biener via Gcc-patches
The following reduces the number of SSA updates done during autopar OMP expansion, specifically avoiding the cases that just add virtual operands (where maybe none have been before) in dead regions of the CFG. Instead virtual SSA update is delayed until after the pass. There's much more TLC neede

Re: [GCC13][Patch][V2][1/2]Add a new option -fstrict-flex-array[=n] and attribute strict_flex_array(n) and use it in PR101836

2022-08-02 Thread Richard Biener via Gcc-patches
On Mon, 1 Aug 2022, Qing Zhao wrote: > > > > On Aug 1, 2022, at 3:38 AM, Richard Biener wrote: > > > > On Fri, 29 Jul 2022, Qing Zhao wrote: > > > >> Hi, Richard, > >> > >> Thanks a lot for your comments and suggestions. (And sorry for my late > >> reply). > >> > >>> On Jul 28, 2022, at 3:

Re: [COMMITTED] Make irange dependency explicit for range_of_ssa_name_with_loop_info.

2022-08-02 Thread Richard Biener via Gcc-patches
On Mon, Aug 1, 2022 at 8:17 AM Aldy Hernandez via Gcc-patches wrote: > > Even though ranger is type agnostic, SCEV seems to only work with > integers. This patch removes some FIXME notes making it explicit that > bounds_of_var_in_loop only works with iranges. SCEV also handles floats, where do y

[PATCH] Properly honor param_max_fsm_thread_path_insns in backwards threader

2022-08-02 Thread Richard Biener via Gcc-patches
I am trying to make sense of back_threader_profitability::profitable_path_p and the first thing I notice is that we do /* Threading is profitable if the path duplicated is hot but also in a case we separate cold path from hot path and permit optimization of the hot path later. Be on t

Re: [PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-08-02 Thread Richard Biener via Gcc-patches
On Tue, Aug 2, 2022 at 10:33 AM Tamar Christina via Gcc-patches wrote: > > > > > > When this function replaces the edge it doesn't seem to update the > > > > dominators. > > > > > Since It's replacing the middle BB we then end up with an error > > > > > > > > > > gcc/testsuite/gcc.dg/tree-ssa/minm

Re: [PATCH] IPA: reduce what we dump in normal mode

2022-08-02 Thread Richard Biener via Gcc-patches
On Tue, Aug 2, 2022 at 10:46 AM Martin Liška wrote: OK > gcc/ChangeLog: > > * profile.cc (compute_branch_probabilities): Dump details only > if TDF_DETAILS. > * symtab.cc (symtab_node::dump_base): Do not dump pointer unless > TDF_ADDRESS is used, it makes comparis

[PATCH] tree-optimization/106497 - more forward threader can-copy-bb

2022-08-02 Thread Richard Biener via Gcc-patches
This adds EDGE_COPY_SRC_JOINER_BLOCK sources to the set of blocks we need to check we can duplicate. Bootstrapped and tested on x86-64-unknown-linux-gnu, pushed. PR tree-optimization/106497 * tree-ssa-threadupdate.cc (fwd_jt_path_registry::update_cfg): Also verify we can c

Re: [PATCH] Properly honor param_max_fsm_thread_path_insns in backwards threader

2022-08-02 Thread Richard Biener via Gcc-patches
On Tue, 2 Aug 2022, Aldy Hernandez wrote: > Unfortunately, this was before my time, so I don't know. > > That being said, thanks for tackling these issues that my work > triggered last release. Much appreciated. Ah. But it was your r12-324-g69e5544210e3c0 that did - else if (n_insns > 1) +

[PATCH] autopar TLC

2022-08-02 Thread Richard Biener via Gcc-patches
The following removes all excessive update_ssa calls from OMP expansion, thereby rewriting the atomic load and store cases to GIMPLE code generation. I don't think autopar ever exercises the atomics code though. There's not much test coverage overall so I've built SPEC 2k17 with -floop-paralleliz

Re: [PATCH] Properly honor param_max_fsm_thread_path_insns in backwards threader

2022-08-02 Thread Richard Biener via Gcc-patches
On Tue, 2 Aug 2022, Aldy Hernandez wrote: > On Tue, Aug 2, 2022 at 1:45 PM Richard Biener wrote: > > > > On Tue, 2 Aug 2022, Aldy Hernandez wrote: > > > > > Unfortunately, this was before my time, so I don't know. > > > > > > That being said, thanks for tackling these issues that my work > > > tr

Re: [COMMITTED] Make irange dependency explicit for range_of_ssa_name_with_loop_info.

2022-08-02 Thread Richard Biener via Gcc-patches
On Tue, Aug 2, 2022 at 1:41 PM Aldy Hernandez wrote: > > On Tue, Aug 2, 2022 at 9:19 AM Richard Biener > wrote: > > > > On Mon, Aug 1, 2022 at 8:17 AM Aldy Hernandez via Gcc-patches > > wrote: > > > > > > Even though ranger is type agnostic, SCEV seems to only work with > > > integers. This pat

Re: [COMMITTED] Make irange dependency explicit for range_of_ssa_name_with_loop_info.

2022-08-02 Thread Richard Biener via Gcc-patches
On Tue, Aug 2, 2022 at 2:11 PM Aldy Hernandez wrote: > > On Tue, Aug 2, 2022 at 2:07 PM Richard Biener > wrote: > > > > On Tue, Aug 2, 2022 at 1:41 PM Aldy Hernandez wrote: > > > > > > On Tue, Aug 2, 2022 at 9:19 AM Richard Biener > > > wrote: > > > > > > > > On Mon, Aug 1, 2022 at 8:17 AM Aldy

[PATCH] Properly honor param_max_fsm_thread_path_insns in backwards threader

2022-08-02 Thread Richard Biener via Gcc-patches
I am trying to make sense of back_threader_profitability::profitable_path_p and the first thing I notice is that we do /* Threading is profitable if the path duplicated is hot but also in a case we separate cold path from hot path and permit optimization of the hot path later. Be on t

Re: [PATCH] Properly honor param_max_fsm_thread_path_insns in backwards threader

2022-08-02 Thread Richard Biener via Gcc-patches
On Tue, 2 Aug 2022, Aldy Hernandez wrote: > On Tue, Aug 2, 2022 at 1:59 PM Richard Biener wrote: > > > > On Tue, 2 Aug 2022, Aldy Hernandez wrote: > > > > > On Tue, Aug 2, 2022 at 1:45 PM Richard Biener wrote: > > > > > > > > On Tue, 2 Aug 2022, Aldy Hernandez wrote: > > > > > > > > > Unfortunat

RE: [PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-08-03 Thread Richard Biener via Gcc-patches
On Wed, 3 Aug 2022, Tamar Christina wrote: > > > -Original Message- > > From: Richard Biener > > Sent: Tuesday, August 2, 2022 10:11 AM > > To: Tamar Christina > > Cc: Richard Biener ; ja...@redhat.com; nd > > ; gcc-patches@gcc.gnu.org > > Subject: Re: [PATCH 2/2]middle-end: Support rec

[PATCH] backwards threader costing TLC and a fix

2022-08-03 Thread Richard Biener via Gcc-patches
The previous change to the backwards threader costing contained a mistake that can make us reject a path based on size when the full thread path is not know yet and the full path would be considered hot but the partial path not yet. Instead of adding another simple fix for this particular issue I

[PATCH] Backwards threader greedy search TLC

2022-08-03 Thread Richard Biener via Gcc-patches
I've tried to understand how the greedy search works seeing the bitmap dances and the split into resolve_phi. I've summarized the intent of the algorithm as // For further greedy searching we want to remove interesting // names defined in BB but add ones on the PHI edges for the

Re: [PATCH] Properly honor param_max_fsm_thread_path_insns in backwards threader

2022-08-03 Thread Richard Biener via Gcc-patches
On Tue, 2 Aug 2022, Jan Hubicka wrote: > > On Tue, 2 Aug 2022, Aldy Hernandez wrote: > > > > > On Tue, Aug 2, 2022 at 1:45 PM Richard Biener wrote: > > > > > > > > On Tue, 2 Aug 2022, Aldy Hernandez wrote: > > > > > > > > > Unfortunately, this was before my time, so I don't know. > > > > > > > >

Re: [PATCH] RFC: Extend SLP permutation optimisations

2022-08-03 Thread Richard Biener via Gcc-patches
On Tue, 2 Aug 2022, Richard Sandiford wrote: > Currently SLP tries to force permute operations "down" the graph > from loads in the hope of reducing the total number of permutes > needed or (in the best case) removing the need for the permutes > entirely. This patch tries to extend it as follows:

RE: [PATCH 1/2]middle-end: Simplify subtract where both arguments are being bitwise inverted.

2022-08-03 Thread Richard Biener via Gcc-patches
On Wed, 3 Aug 2022, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Tuesday, June 21, 2022 8:43 AM > > To: Tamar Christina > > Cc: Richard Sandiford ; Richard Biener via Gcc- > > patches ; Richard Guenther > > ;

<    1   2   3   4   5   6   7   8   9   10   >