[PATCH] s390: Make use of new copysign RTL

2023-10-05 Thread Stefan Schulze Frielinghaus
gcc/ChangeLog: * config/s390/s390.md: Make use of new copysign RTL. --- gcc/config/s390/s390.md | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 9631b2a8c60..3f29ba21442 100644 --- a/gcc/config/s390/s390.md +

[PATCH] Avoid left around copies when value-numbering BBs

2023-10-05 Thread Richard Biener
The following makes sure to treat values whose definition we didn't visit as available since those by definition must dominate the entry of the region. That avoids unpropagated copies after if-conversion and resulting SLP discovery fails (which doesn't handle plain copies). Bootstrapped and teste

Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction.

2023-10-05 Thread Robin Dapp
Hi Tamar, > So in the > > if (slp_node) > { > > Add something like: > > If (is_cond_op) > { > if (dump_enabled_p ()) > dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, >"left fold reduction on SLP not supported.\n"); > return false; >

Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction.

2023-10-05 Thread Robin Dapp
Ah, sorry, read your remark incorrectly. Will try again. Regards Robin

[X86 PATCH] Split lea into shorter left shift by 2 or 3 bits with -Oz.

2023-10-05 Thread Roger Sayle
This patch avoids long lea instructions for performing x<<2 and x<<3 by splitting them into shorter sal and move (or xchg instructions). Because this increases the number of instructions, but reduces the total size, its suitable for -Oz (but not -Os). The impact can be seen in the new test case:

Re: [PATCH] wwwdocs: Add ADL to C++ non-bugs

2023-10-05 Thread Jonathan Wakely
On Wed, 4 Oct 2023 at 20:17, Jason Merrill wrote: > > On 10/3/23 10:45, Jonathan Wakely wrote: > > We have a long history of INVALID bugs about std functions being > > available in the global namespace (PRs 27846, 67566, 82619, 99865, > > 110602, 111553, probably others). Let's document it. > > >

Re: [X86 PATCH] Split lea into shorter left shift by 2 or 3 bits with -Oz.

2023-10-05 Thread Uros Bizjak
On Thu, Oct 5, 2023 at 11:06 AM Roger Sayle wrote: > > > This patch avoids long lea instructions for performing x<<2 and x<<3 > by splitting them into shorter sal and move (or xchg instructions). > Because this increases the number of instructions, but reduces the > total size, its suitable for -O

[PATCH] Fix SIMD call SLP discovery

2023-10-05 Thread Richard Biener
When we do SLP discovery of SIMD calls we run into the issue that when the call is neither builtin nor internal function we have cfn == CFN_LAST but internal_fn_p of that returns true. Since IFN_LAST isn't vectorizable we fail spuriously. Fixed by checking for cfn != CFN_LAST && internal_fn_p (cf

Re: [PATCH 1/6] aarch64: Sync system register information with Binutils

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: This patch adds the `aarch64-sys-regs.def' file to GCC, teaching the compiler about system registers known to the assembler and how these can be used. The macros used to hold system register information reflect those in use by binutils, a desig

[committed 1/5] arc: Remove unused/incomplete alignment assembly annotation.

2023-10-05 Thread Claudiu Zissulescu
Removes '&' print operant punct character, disable -mannotate-align option and clean up the port. gcc/ * config/arc/arc-protos.h (arc_clear_unalign): Remove. (arc_toggle_unalign): Likewise. * config/arc/arc.cc (machine_function) Remove unalign. (arc_init): Remove `

[X86 PATCH] Implement doubleword shift left by 1 bit using add+adc.

2023-10-05 Thread Roger Sayle
This patch tweaks the i386 back-end's ix86_split_ashl to implement doubleword left shifts by 1 bit, using an add followed by an add-with-carry (i.e. a doubleword x+x) instead of using the x86's shld instruction. The replacement sequence both requires fewer bytes and is faster on both Intel and AM

[committed 2/5] arc: Update/remove ARC specific tests

2023-10-05 Thread Claudiu Zissulescu
Update tests and remove old mtune-* tests. gcc/testsuite * gcc.target/arc/add_n-combine.c: Recognize add2 instruction. * gcc.target/arc/firq-4.c: FP register is a temp reg. Update test. * gcc.target/arc/firq-6.c: Likewise. * gcc.target/arc/mtune-ARC600.c: Remove te

[committed 3/5] arc: Remove '^' print punct character

2023-10-05 Thread Claudiu Zissulescu
The '^' was used to print '@' character in the ouput assembly. This is not anylonger required by the ARC binutils. Remove it. gcc/ * config/arc/arc.cc (arc_init): Remove '^' punct char. (arc_print_operand): Remove related code. * config/arc/arc.md: Update patterns which us

[committed 5/5] arc: Update tests predicates when using linux toolchain.

2023-10-05 Thread Claudiu Zissulescu
gcc/testsuite: * gcc.target/arc/enter-dw2-1.c: Remove tests when using linux build. * gcc.target/arc/tls-ld.c: Update test. * gcc.target/arc/tls-le.c: Likewise. Signed-off-by: Claudiu Zissulescu --- gcc/testsuite/gcc.target/arc/enter-dw2-1.c | 18 +---

RE: [X86 PATCH] Implement doubleword shift left by 1 bit using add+adc.

2023-10-05 Thread Roger Sayle
Doh! ENOPATCH. > -Original Message- > From: Roger Sayle > Sent: 05 October 2023 12:44 > To: 'gcc-patches@gcc.gnu.org' > Cc: 'Uros Bizjak' > Subject: [X86 PATCH] Implement doubleword shift left by 1 bit using add+adc. > > > This patch tweaks the i386 back-end's ix86_split_ashl to imple

[committed 4/5] arc: Remove obsolete ccfsm instruction predication mechanism

2023-10-05 Thread Claudiu Zissulescu
Remove old ccfsm responsible for conditional execution support in ARC. This machinery is not needed as the current gcc conditional execution support is mature. gcc/ * config/arc/arc-passes.def: Remove arc_ifcvt pass. * config/arc/arc-protos.h (arc_ccfsm_branch_deleted_p): Remove.

RE: [PATCH v1] Mode-Switching: Add optional EMIT_AFTER hook

2023-10-05 Thread Li, Pan2
Thanks Jeff and Robin for comments, sorry for late reply. > Conceptually the rounding mode is just a property. The call, in effect, > should demand a "normal" rounding mode and set the rounding mode to > unknown if I understand how this is supposed to work. If my > understanding is wrong, the

Re: [PATCH v2] ipa-utils: avoid uninitialized probabilities on ICF [PR111559]

2023-10-05 Thread Jan Hubicka
> From: Sergei Trofimovich > > r14-3459-g0c78240fd7d519 "Check that passes do not forget to define profile" > exposed check failures in cases when gcc produces uninitialized profile > probabilities. In case of PR/111559 uninitialized profile is generated > by edges executed 0 times reported by IP

[pushed] wwwdocs: conduct: Use instead of

2023-10-05 Thread Gerald Pfeifer
On the way break overly long lines. Pushed. Gerald --- htdocs/conduct-faq.html | 3 ++- htdocs/conduct-report.html | 3 ++- htdocs/conduct-response.html | 3 ++- htdocs/conduct.html | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/conduct-faq.html b/

[PATCH] Revert "ipa: Self-DCE of uses of removed call LHSs (PR 108007)"

2023-10-05 Thread Martin Jambor
Hello, I am going to commit the following patch to fix PR 111688 (bootstrap on ppc64le broken) and will re-fix 108007 (issues with IPA-SRA when user explicitely turns off DCE) when I figure out what's going wrong. Sorry for the breakage, Martin [PATCH] Revert "ipa: Self-DCE of uses of removed

RE: [PATCH] RISC-V: Remove @ of vec_series

2023-10-05 Thread Li, Pan2
Committed, thanks Jeff and Robin. Pan -Original Message- From: Jeff Law Sent: Wednesday, October 4, 2023 11:40 PM To: Robin Dapp ; Juzhe-Zhong ; gcc-patches@gcc.gnu.org Cc: kito.ch...@gmail.com; kito.ch...@sifive.com Subject: Re: [PATCH] RISC-V: Remove @ of vec_series On 10/4/23 09:

Re: [PATCH 2/6] aarch64: Add support for aarch64-sys-regs.def

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: This patch defines the structure of a new .def file used for representing the aarch64 system registers, what information it should hold and the basic framework in GCC to process this file. Entries in the aarch64-system-regs.def file should be a

Re: [X86 PATCH] Implement doubleword shift left by 1 bit using add+adc.

2023-10-05 Thread Uros Bizjak
On Thu, Oct 5, 2023 at 1:45 PM Roger Sayle wrote: > > Doh! ENOPATCH. > > > -Original Message- > > From: Roger Sayle > > Sent: 05 October 2023 12:44 > > To: 'gcc-patches@gcc.gnu.org' > > Cc: 'Uros Bizjak' > > Subject: [X86 PATCH] Implement doubleword shift left by 1 bit using > add+adc.

RE: [X86 PATCH] Split lea into shorter left shift by 2 or 3 bits with -Oz.

2023-10-05 Thread Roger Sayle
Hi Uros, Very many thanks for the speedy reviews. Uros Bizjak wrote: > On Thu, Oct 5, 2023 at 11:06 AM Roger Sayle > wrote: > > > > > > This patch avoids long lea instructions for performing x<<2 and x<<3 > > by splitting them into shorter sal and move (or xchg instructions). > > Because this i

[PATCH 1/3] ipa-cp: Templatize filtering of m_agg_values

2023-10-05 Thread Martin Jambor
PR 57 points to another place where IPA-CP collected aggregate compile-time constants need to be filtered, in addition to the one place that already does this in ipa-sra. In order to re-use code, this patch turns the common bit into a template. The functionality is still covered by testcase g

[PATCH 3/3] ipa: Limit pruning of IPA-CP aggregate constants if there are loads

2023-10-05 Thread Martin Jambor
This patch makes the previous one less conservative by looking whether there are known ipa-modref loads from areas covered by the IPA-CP aggregate constant entry in question. Because ipa-modref relies on alias information which IPA-CP does not have (yet), the test is much more crude and only repor

[PATCH 2/3] ipa: Prune any IPA-CP aggregate constants known by modref to be killed (111157)

2023-10-05 Thread Martin Jambor
PR 57 shows that IPA-modref and IPA-CP (when plugged into value numbering) can optimize out a store both before a call (because the call will overwrite it) and in the call (because the store is of the same value) and by eliminating both create miscompilation. This patch fixes that by pruning a

Re: [PATCH 3/6] aarch64: Implement system register validation tools

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: Given the implementation of a mechanism of encoding system registers into GCC, this patch provides the mechanism of validating their use by the compiler. In particular, this involves: 1. Ensuring a supplied string corresponds to a known sys

[PATCH] ipa: Remove ipa_bits

2023-10-05 Thread Jakub Jelinek
Hi! The following patch removes ipa_bits struct pointer/vector from ipa jump functions and ipa cp transformations. The reason is because the struct uses widest_int to represent mask/value pair, which in the RFC patches to allow larger precisions for wide_int/widest_int is GC unfriendly because th

Re: [PATCH 4/6] aarch64: Add basic target_print_operand support for CONST_STRING

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: Motivated by the need to print system register names in output assembly, this patch adds the required logic to `aarch64_print_operand' to accept rtxs of type CONST_STRING and process these accordingly. Consequently, an rtx such as: (set (re

[committed] sreal: Fix typo in function name

2023-10-05 Thread Jakub Jelinek
Hi! My earlier version of the ipa_bits removal patch resulted in self-test failures in sreal. When debugging it, I was really confused that I couldn't find verify_arithmetics function in the source. Turns out it had bad spelling... Bootstrapped/regtested on x86_64-linux and i686-linux, committe

Re: [PATCH 5/6] aarch64: Implement system register r/w arm ACLE intrinsic functions

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: Implement the aarch64 intrinsics for reading and writing system registers with the following signatures: uint32_t __arm_rsr(const char *special_register); uint64_t __arm_rsr64(const char *special_register); void* __arm_r

Re: [PATCH v2] ipa-utils: avoid uninitialized probabilities on ICF [PR111559]

2023-10-05 Thread Sergei Trofimovich
On Thu, Oct 05, 2023 at 01:52:30PM +0200, Jan Hubicka wrote: > > From: Sergei Trofimovich > > > > r14-3459-g0c78240fd7d519 "Check that passes do not forget to define profile" > > exposed check failures in cases when gcc produces uninitialized profile > > probabilities. In case of PR/111559 uninit

Re: [PATCH 4/6] aarch64: Add basic target_print_operand support for CONST_STRING

2023-10-05 Thread Victor Do Nascimento
On 10/5/23 13:26, Richard Earnshaw wrote: On 03/10/2023 16:18, Victor Do Nascimento wrote: Motivated by the need to print system register names in output assembly, this patch adds the required logic to `aarch64_print_operand' to accept rtxs of type CONST_STRING and process these accordingly.

Re: [PATCH 6/6] aarch64: Add front-end argument type checking for target builtins

2023-10-05 Thread Richard Earnshaw
On 03/10/2023 16:18, Victor Do Nascimento wrote: In implementing the ACLE read/write system register builtins it was observed that leaving argument type checking to be done at expand-time meant that poorly-formed function calls were being "fixed" by certain optimization passes, meaning bad cod

Re: [PATCH 4/6] aarch64: Add basic target_print_operand support for CONST_STRING

2023-10-05 Thread Richard Earnshaw
On 05/10/2023 13:26, Richard Earnshaw wrote: On 03/10/2023 16:18, Victor Do Nascimento wrote: Motivated by the need to print system register names in output assembly, this patch adds the required logic to `aarch64_print_operand' to accept rtxs of type CONST_STRING and process these accordin

Re: [PATCH 01/22] Add condition coverage profiling

2023-10-05 Thread Jan Hubicka
> > Like Wahlen et al this implementation records coverage in fixed-size > bitsets which gcov knows how to interpret. This is very fast, but > introduces a limit on the number of terms in a single boolean > expression, the number of bits in a gcov_unsigned_type (which is > typedef'd to uint64_t),

Re: [PATCH 06/22] Use popcount_hwi rather than builtin

2023-10-05 Thread Jan Hubicka
Hi, can you please also squash those changes which fixes patch #1 so it is easier to review? Honza > From: Jørgen Kvalsvik > > --- > gcc/gcov.cc | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gcc/gcov.cc b/gcc/gcov.cc > index 274f2fc5d9f..35be97cf5ac 100644 > --- a/g

Re: [PATCH v2] ipa-utils: avoid uninitialized probabilities on ICF [PR111559]

2023-10-05 Thread Jan Hubicka
> diff --git a/gcc/ipa-utils.cc b/gcc/ipa-utils.cc > index 956c6294fd7..1355ccac6f0 100644 > --- a/gcc/ipa-utils.cc > +++ b/gcc/ipa-utils.cc > @@ -651,13 +651,16 @@ ipa_merge_profiles (struct cgraph_node *dst, > { > edge srce = EDGE_SUCC (srcbb, i); > e

Re: [PATCH 1/6] aarch64: Sync system register information with Binutils

2023-10-05 Thread Victor Do Nascimento
On 10/5/23 12:42, Richard Earnshaw wrote: On 03/10/2023 16:18, Victor Do Nascimento wrote: This patch adds the `aarch64-sys-regs.def' file to GCC, teaching the compiler about system registers known to the assembler and how these can be used. The macros used to hold system register informat

[avr,committed] Use monic denominator polynomials to save a multiplication.

2023-10-05 Thread Georg-Johann Lay
This is a small tweak in LibF7 to save one multiplication in computation of denominator polynomials. The polynomials are monic now, and f7_horner needs one multiplication less. Johann -- LibF7: Use monic denominator polynomials to save a multiplication. libgcc/config/avr/libf7/ * libf

Re: [PATCH 1/3] ipa-cp: Templatize filtering of m_agg_values

2023-10-05 Thread Jan Hubicka
> PR 57 points to another place where IPA-CP collected aggregate > compile-time constants need to be filtered, in addition to the one > place that already does this in ipa-sra. In order to re-use code, > this patch turns the common bit into a template. > > The functionality is still covered b

[PATCH v4] ipa-utils: avoid uninitialized probabilities on ICF [PR111559]

2023-10-05 Thread Sergei Trofimovich
On Thu, Oct 05, 2023 at 03:04:55PM +0200, Jan Hubicka wrote: > > diff --git a/gcc/ipa-utils.cc b/gcc/ipa-utils.cc > > index 956c6294fd7..1355ccac6f0 100644 > > --- a/gcc/ipa-utils.cc > > +++ b/gcc/ipa-utils.cc > > @@ -651,13 +651,16 @@ ipa_merge_profiles (struct cgraph_node *dst, > > {

Re: [PATCH 2/3] ipa: Prune any IPA-CP aggregate constants known by modref to be killed (111157)

2023-10-05 Thread Jan Hubicka
> gcc/ChangeLog: > > 2023-09-19 Martin Jambor > > PR ipa/57 > * ipa-prop.h (struct ipa_argagg_value): Newf flag killed. > * ipa-modref.cc (ipcp_argagg_and_kill_overlap_p): New function. > (update_signature): Mark any any IPA-CP aggregate constants at > positio

Re: [PATCH v4] ipa-utils: avoid uninitialized probabilities on ICF [PR111559]

2023-10-05 Thread Jan Hubicka
> On Thu, Oct 05, 2023 at 03:04:55PM +0200, Jan Hubicka wrote: > > > diff --git a/gcc/ipa-utils.cc b/gcc/ipa-utils.cc > > > index 956c6294fd7..1355ccac6f0 100644 > > > --- a/gcc/ipa-utils.cc > > > +++ b/gcc/ipa-utils.cc > > > @@ -651,13 +651,16 @@ ipa_merge_profiles (struct cgraph_node *dst, > > >

[avr,committed] Remove all uses of attribute pure from LibF7.

2023-10-05 Thread Georg-Johann Lay
Applied the following patch. Johann LibF7: Remove uses of attribute pure. libgcc/config/avr/libf7/ * libf7.h (F7_PURE): Remove all occurrences. * libf7.c: Same. diff --git a/libgcc/config/avr/libf7/libf7.c b/libgcc/config/avr/libf7/libf7.c index 373a8a55d90..0d9e4c325b2 1006

Re: [RFC] expr: don't clear SUBREG_PROMOTED_VAR_P flag for a promoted subreg [target/111466]

2023-10-05 Thread Robin Dapp
> So I think Kenner's code is trying to prevent having a value in a > SUBREG that is inconsistent with the SUBREG_PROMOTED* flag bits. But > I think it's been unnecessary since Matz's rewrite in 2009. I couldn't really tell what the rewrite does entirely so I tried creating a case where we would

Re: [PATCH 01/22] Add condition coverage profiling

2023-10-05 Thread Jørgen Kvalsvik
On 05/10/2023 21:59, Jan Hubicka wrote: Like Wahlen et al this implementation records coverage in fixed-size bitsets which gcov knows how to interpret. This is very fast, but introduces a limit on the number of terms in a single boolean expression, the number of bits in a gcov_unsigned_type (whi

Re: [PATCH] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-05 Thread Kito Cheng
Hi Robin: Your suggested code seems work fine, let me run more test and send v2, I guess I just don’t know how to explain why it work in comment :p Robin Dapp 於 2023年10月5日 週四,03:57寫道: > >> I think the "max poly value" is the LMUL 1 mode coeffs[1] > >> > >> See int vlenb = BYTES_PER_RISCV_VECTOR.

RE: [PATCH]middle-end: Recursively check is_trivially_copyable_or_pair in vec.h

2023-10-05 Thread Tamar Christina
> On Tue, Oct 03, 2023 at 11:41:01AM +, Tamar Christina wrote: > > > We have stablesort method instead of qsort but that would require > > > consistent ordering in the vector (std::sort doesn't ensure stable > > > sorting either). > > > > > > If it is a non-issue, the patch is ok with the above

Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction.

2023-10-05 Thread Robin Dapp
Hi Tamar, > The only comment I have is whether you actually need this helper > function? It looks like all the uses of it are in cases you have, or > will call conditional_internal_fn_code directly. removed the cond_fn_p entirely in the attached v3. Bootstrapped and regtested on x86_64, aarch64 a

[PATCH v5] Add condition coverage profiling

2023-10-05 Thread Jørgen Kvalsvik
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it is required for or reco

Re: [PATCH]middle-end: Recursively check is_trivially_copyable_or_pair in vec.h

2023-10-05 Thread Jakub Jelinek
On Thu, Oct 05, 2023 at 02:01:40PM +, Tamar Christina wrote: > gcc/ChangeLog: > > * tree-if-conv.cc (INCLUDE_ALGORITHM): Remove. > (typedef struct ifcvt_arg_entry): New. > (cmp_arg_entry): New. > (gen_phi_arg_condition, gen_phi_nest_statement, > predicate_scalar_p

RE: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction.

2023-10-05 Thread Tamar Christina
Hi Robin, > -Original Message- > From: Robin Dapp > Sent: Thursday, October 5, 2023 3:06 PM > To: Tamar Christina ; gcc-patches patc...@gcc.gnu.org>; Richard Biener > Cc: rdapp@gmail.com > Subject: Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar > reduction. > > Hi Tam

Re: [PATCH 01/22] Add condition coverage profiling

2023-10-05 Thread Jørgen Kvalsvik
On 05/10/2023 22:39, Jørgen Kvalsvik wrote: On 05/10/2023 21:59, Jan Hubicka wrote: Like Wahlen et al this implementation records coverage in fixed-size bitsets which gcov knows how to interpret. This is very fast, but introduces a limit on the number of terms in a single boolean expression, th

Re: [PATCH] ipa: Remove ipa_bits

2023-10-05 Thread Aldy Hernandez
On Thu, Oct 5, 2023, 8:26 a.m. Jakub Jelinek wrote: > Hi! > > The following patch removes ipa_bits struct pointer/vector from ipa > jump functions and ipa cp transformations. > > The reason is because the struct uses widest_int to represent > mask/value pair, which in the RFC patches to allow lar

Re: [PATCH 01/22] Add condition coverage profiling

2023-10-05 Thread Jan Hubicka
> On 05/10/2023 22:39, Jørgen Kvalsvik wrote: > > On 05/10/2023 21:59, Jan Hubicka wrote: > > > > > > > > Like Wahlen et al this implementation records coverage in fixed-size > > > > bitsets which gcov knows how to interpret. This is very fast, but > > > > introduces a limit on the number of terms

Re: [PATCH] ipa: Remove ipa_bits

2023-10-05 Thread Jan Hubicka
> Hi! > > The following patch removes ipa_bits struct pointer/vector from ipa > jump functions and ipa cp transformations. > > The reason is because the struct uses widest_int to represent > mask/value pair, which in the RFC patches to allow larger precisions > for wide_int/widest_int is GC unfri

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

2023-10-05 Thread Jeff Law
On 10/3/23 05:45, Manolis Tsamis wrote: This is a new RTL pass that tries to optimize memory offset calculations + +/* If INSN is a root memory instruction then compute a potentially new offset + for it and test if the resulting instruction is valid. */ +static void +do_check_validity (r

Re: [RFC] expr: don't clear SUBREG_PROMOTED_VAR_P flag for a promoted subreg [target/111466]

2023-10-05 Thread Richard Kenner
> At that particular time I think Kenner was mostly focused on the alpha > and ppc ports, but I think he was also still poking around with romp and > a29k. I think romp is an unlikely target for this because it didn't > promote modes and it wasn't even building for several months > (April->lat

Re: [PATCH] ipa: Remove ipa_bits

2023-10-05 Thread Jakub Jelinek
On Thu, Oct 05, 2023 at 04:42:42PM +0200, Jan Hubicka wrote: > It does look like a nice cleanup to me. > I wonder if you did some compare of the bit information propagated with > new code and old code? Theoretically they should be equivalent? Beyond testsuite, I've tried __attribute__((noinline,

Re: [RFC] expr: don't clear SUBREG_PROMOTED_VAR_P flag for a promoted subreg [target/111466]

2023-10-05 Thread Jeff Law
On 10/5/23 08:56, Richard Kenner wrote: At that particular time I think Kenner was mostly focused on the alpha and ppc ports, but I think he was also still poking around with romp and a29k. I think romp is an unlikely target for this because it didn't promote modes and it wasn't even building

Re: [PATCH 01/22] Add condition coverage profiling

2023-10-05 Thread Jørgen Kvalsvik
On 05/10/2023 21:59, Jan Hubicka wrote: Like Wahlen et al this implementation records coverage in fixed-size bitsets which gcov knows how to interpret. This is very fast, but introduces a limit on the number of terms in a single boolean expression, the number of bits in a gcov_unsigned_type (whi

Re: [PATCH] RISC-V: Fix the riscv_legitimize_poly_move issue on targets where the minimal VLEN exceeds 512.

2023-10-05 Thread Robin Dapp
> Your suggested code seems work fine, let me run more test and send > v2, I guess I just don’t know how to explain why it work in comment > :p If it's too convoluted maybe we should rather not use it :D The idea is for factor % (vlenb / potential_div) == 0 we're actually looking for the larges

[COMMITTED] i386: Improve memory copy from named address space [PR111657]

2023-10-05 Thread Uros Bizjak
The stringop strategy selection algorithm falls back to a libcall strategy when it exhausts its pool of available strategies. The memory area copy function (memcpy) is not available from the system library for non-default address spaces, so the compiler emits the most trivial byte-at-a-time copy l

[committed] contrib: add mdcompact

2023-10-05 Thread Andrea Corallo
Hello all, this patch checks in mdcompact, the tool written in elisp that I used to mass convert all the multi choice pattern in the aarch64 back-end to the new compact syntax. I tested it on Emacs 29 (might run on older versions as well not sure), also I verified it runs cleanly on a few other b

[committed 1/2] secpol: add grammatically missing commas / remove one excess instance

2023-10-05 Thread Siddhesh Poyarekar
From: Jan Engelhardt Signed-off-by: Jan Engelhardt ChangeLog: * SECURITY.txt: Fix up commas. --- SECURITY.txt | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SECURITY.txt b/SECURITY.txt index b65f24cfc2a..93792923583 100644 --- a/SECURITY.txt +++ b

[committed 0/2] SECURITY.txt: Trivial fixups

2023-10-05 Thread Siddhesh Poyarekar
Committed some trivial comma and indentation fixups that Jan shared with me off-list. Jan Engelhardt (2): secpol: add grammatically missing commas / remove one excess instance secpol: consistent indentation SECURITY.txt | 48 1 file changed, 2

[committed 2/2] secpol: consistent indentation

2023-10-05 Thread Siddhesh Poyarekar
From: Jan Engelhardt 86% of the document have 4 spaces; adjust the remaining 14%. Signed-off-by: Jan Engelhardt ChangeLog: * SECURITY.txt: Fix up indentation. --- SECURITY.txt | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/SECUR

Re: [PATCH v2] Add a GCC Security policy

2023-10-05 Thread Richard Earnshaw (lists)
On 28/09/2023 12:55, Siddhesh Poyarekar wrote: > +Security features implemented in GCC > + > + [...] > + > +Similarly, GCC may transform code in a way that the correctness of > +the expressed algorithm is preserved, but supplementary properties > +tha

Re: [PATCH] ira: Scale save/restore costs of callee save registers with block frequency

2023-10-05 Thread Vladimir Makarov
On 10/3/23 10:07, Surya Kumari Jangala wrote: ira: Scale save/restore costs of callee save registers with block frequency In assign_hard_reg(), when computing the costs of the hard registers, the cost of saving/restoring a callee-save hard register in prolog/epilog is taken into consideration.

Re: [RFC] expr: don't clear SUBREG_PROMOTED_VAR_P flag for a promoted subreg [target/111466]

2023-10-05 Thread Jeff Law
On 10/5/23 07:33, Robin Dapp wrote: So I think Kenner's code is trying to prevent having a value in a SUBREG that is inconsistent with the SUBREG_PROMOTED* flag bits. But I think it's been unnecessary since Matz's rewrite in 2009. I couldn't really tell what the rewrite does entirely so I t

Re: [PATCH] RISC-V: xfail gcc.dg/pr90263.c for riscv_v

2023-10-05 Thread Patrick O'Neill
On 10/4/23 15:29, Jeff Law wrote: On 10/4/23 16:21, Patrick O'Neill wrote: On 10/4/23 15:14, Jeff Law wrote: On 10/4/23 15:57, Patrick O'Neill wrote: Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to perform a memcpy. We no longer expect memcpy for riscv_v targets.

Re: [PATCH V5 1/2] rs6000: optimize moving to sf from highpart di

2023-10-05 Thread David Edelsohn
On Thu, Oct 5, 2023 at 12:50 AM Jiufu Guo wrote: > Hi, > > Currently, we have the pattern "movsf_from_si2" which was trying > to support moving high part DI to SF. > > But current pattern only accepts "ashiftrt": > XX:SF=bitcast:SF(subreg(YY:DI>>32),0), but actually "lshiftrt" should > also be ok

Re: [PATCH V5 2/2] rs6000: use mtvsrws to move sf from si p9

2023-10-05 Thread David Edelsohn
On Thu, Oct 5, 2023 at 12:14 AM Jiufu Guo wrote: > Hi, > > As mentioned in PR108338, on p9, we could use mtvsrws to implement > the bitcast from SI to SF (or lowpart DI to SF). > > For example: > *(long long*)buff = di; > float f = *(float*)(buff); > > "sldi 9,3,32 ; mtvsrd 1,9 ; xscvspdpn 1,

[PATCH][_GLIBCXX_INLINE_VERSION] Add missing symbols

2023-10-05 Thread François Dumont
Here is a patch to fix following test case in gcc: gcc/testsuite/g++.dg/cpp23/ext-floating13.C     libstdc++: [_GLIBCXX_INLINE_VERSION] Add missing float symbols     libstdc++-v3/ChangeLog:     * config/abi/pre/gnu-versioned-namespace.ver: Add missing symbols     for _Float{1

Re: [PATCH][_GLIBCXX_INLINE_VERSION] Add missing symbols

2023-10-05 Thread Jonathan Wakely
On Thu, 5 Oct 2023 at 18:04, François Dumont wrote: > > Here is a patch to fix following test case in gcc: > > gcc/testsuite/g++.dg/cpp23/ext-floating13.C > > libstdc++: [_GLIBCXX_INLINE_VERSION] Add missing float symbols > > libstdc++-v3/ChangeLog: > > * config/abi/pre/gnu-

[Patch] libgomp.texi: Document some of the device-memory routines

2023-10-05 Thread Tobias Burnus
I was checking one of those functions - and now ended up documenting some of them. Still to be documented are omp_target_{is_accessible,memcpy*}. I did run into some possibly questionable code for corner cases and have filed https://gcc.gnu.org/PR111707 for those. The documentation matches the cu

RE: [PATCH]middle-end match.pd: optimize fneg (fabs (x)) to x | (1 << signbit(x)) [PR109154]

2023-10-05 Thread Tamar Christina
> > b17e1136600a 100644 > > --- a/gcc/match.pd > > +++ b/gcc/match.pd > > @@ -9476,3 +9476,57 @@ and, > > } > > (if (full_perm_p) > > (vec_perm (op@3 @0 @1) @3 @2)) > > + > > +/* Transform fneg (fabs (X)) -> X | 1 << signbit (X). */ > > + > > +(simplify > > + (negate (abs @

RE: [PATCH]middle-end match.pd: optimize fneg (fabs (x)) to x | (1 << signbit(x)) [PR109154]

2023-10-05 Thread Tamar Christina
> I suppose the idea is that -abs(x) might be easier to optimize with other > patterns (consider a - copysign(x,...), optimizing to a + abs(x)). > > For abs vs copysign it's a canonicalization, but (negate (abs @0)) is less > canonical than copysign. > > > Should I try removing this? > > I'd say

RE: [PATCH]AArch64: Use SVE unpredicated LOGICAL expressions when Advanced SIMD inefficient [PR109154]

2023-10-05 Thread Tamar Christina
> >> > >> The WIP SME patches add a %Z modifier for 'z' register prefixes, > >> similarly to b/h/s/d for scalar FP. With that I think the alternative can > >> be: > >> > >> [w , 0 , ; * , sve ] \t%Z0., %Z0., #%2 > >> > >> although it would be nice to keep the hex constant. > > > > My

RE: [PATCH]AArch64 Add special patterns for creating DI scalar and vector constant 1 << 63 [PR109154]

2023-10-05 Thread Tamar Christina
Hi, > The lowpart_subreg should simplify this back into CONST0_RTX (mode), > making it no different from: > > emti_move_insn (target, CONST0_RTX (mode)); > > If the intention is to share zeros between modes (sounds good!), then I think > the subreg needs to be on the lhs instead. > > > +

[PATCH]middle-end ifcvt: Allow any const IFN in conditional blocks

2023-10-05 Thread Tamar Christina
Hi All, When ifcvt was initially added masking was not a thing and as such it was rather conservative in what it supported. For builtins it only allowed C99 builtin functions which it knew it can fold away. These days the vectorizer is able to deal with needing to mask IFNs itself. vectorizable_

[PATCH]AArch64 Handle copysign (x, -1) expansion efficiently

2023-10-05 Thread Tamar Christina
Hi All, copysign (x, -1) is effectively fneg (abs (x)) which on AArch64 can be most efficiently done by doing an OR of the signbit. The middle-end will optimize fneg (abs (x)) now to copysign as the canonical form and so this optimizes the expansion. If the target has an inclusive-OR that takes

[PATCH]middle-end ifcvt: Add support for conditional copysign

2023-10-05 Thread Tamar Christina
Hi All, This adds a masked variant of copysign. Nothing very exciting just the general machinery to define and use a new masked IFN. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Note: This patch is part of a testseries and tests for it are added in the AArch64 patch that adds

[PATCH]AArch64 Add SVE implementation for cond_copysign.

2023-10-05 Thread Tamar Christina
Hi All, This adds an implementation for masked copysign along with an optimized pattern for masked copysign (x, -1). Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: PR tree-optimization/109154 * config/aarch64/aarch64

Re: [PATCH]AArch64 Handle copysign (x, -1) expansion efficiently

2023-10-05 Thread Andrew Pinski
On Thu, Oct 5, 2023 at 11:22 AM Tamar Christina wrote: > > Hi All, > > copysign (x, -1) is effectively fneg (abs (x)) which on AArch64 can be > most efficiently done by doing an OR of the signbit. > > The middle-end will optimize fneg (abs (x)) now to copysign as the > canonical form and so this o

Re: [V3][PATCH 1/3] Provide counted_by attribute to flexible array member field (PR108896)

2023-10-05 Thread Siddhesh Poyarekar
On 2023-08-25 11:24, Qing Zhao wrote: Provide a new counted_by attribute to flexible array member field. The obligatory "I can't ack the patch but here's a review" disclaimer :) 'counted_by (COUNT)' The 'counted_by' attribute may be attached to the flexible array member of a stru

[COMMITTED 2/3] Add a dom based ranger for fast VRP.

2023-10-05 Thread Andrew MacLeod
This patch adds a DOM based ranger that is intended to be used by a dom walk pass and provides basic ranges. It utilizes the new GORI edge API to find outgoing ranges on edges, and combines these with any ranges calculated during the walk up to this point.  When a query is made for a range not

[COMMITTED 1/3] Add outgoing range vector calculation API.

2023-10-05 Thread Andrew MacLeod
This patch adds 2 routine that can be called to generate GORI information. The primar API is: bool gori_on_edge (class ssa_cache &r, edge e, range_query *query = NULL, gimple_outgoing_range *ogr = NULL); This will populate an ssa-cache R with any ranges that are generated by edge E.   It will

[COMMITTED 3/3] Create a fast VRP pass

2023-10-05 Thread Andrew MacLeod
This patch adds a fast VRP pass.  It is not invoked from anywhere, so should cause no issues. If you want to utilize it, simply add a new pass, ie: --- a/gcc/passes.def +++ b/gcc/passes.def @@ -92,6 +92,7 @@ along with GCC; see the file COPYING3.  If not see   NEXT_PASS (pass_phiprop);

[COMMITTED 0/3] Add a FAST VRP pass.

2023-10-05 Thread Andrew MacLeod
the following set of 3 patches provide the infrastructure for a fast vrp pass. The pass is currently not invoked anywhere, but I wanted to get the infrastructure bits in place now... just in case we want to use it somewhere. It clearly bootstraps with no regressions since it isn't being invo

Re: [PATCH]AArch64 Add SVE implementation for cond_copysign.

2023-10-05 Thread Richard Sandiford
Tamar Christina writes: > Hi All, > > This adds an implementation for masked copysign along with an optimized > pattern for masked copysign (x, -1). It feels like we're ending up with a lot of AArch64-specific code that just hard-codes the observation that changing the sign is equivalent to chang

Re: [V3][PATCH 1/3] Provide counted_by attribute to flexible array member field (PR108896)

2023-10-05 Thread Siddhesh Poyarekar
On 2023-10-05 14:51, Siddhesh Poyarekar wrote: On 2023-08-25 11:24, Qing Zhao wrote: Provide a new counted_by attribute to flexible array member field. The obligatory "I can't ack the patch but here's a review" disclaimer :) 'counted_by (COUNT)'   The 'counted_by' attribute may be attac

Re: [PATCH]AArch64 Add special patterns for creating DI scalar and vector constant 1 << 63 [PR109154]

2023-10-05 Thread Richard Sandiford
Tamar Christina writes: > Hi, > >> The lowpart_subreg should simplify this back into CONST0_RTX (mode), >> making it no different from: >> >> emti_move_insn (target, CONST0_RTX (mode)); >> >> If the intention is to share zeros between modes (sounds good!), then I think >> the subreg needs to

RE: [PATCH]AArch64 Add SVE implementation for cond_copysign.

2023-10-05 Thread Tamar Christina
> -Original Message- > From: Richard Sandiford > Sent: Thursday, October 5, 2023 8:29 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; Marcus Shawcroft > ; Kyrylo Tkachov > Subject: Re: [PATCH]AArch64 Add SVE implementation for cond_copysign. > > Tamar C

Re: [V3][PATCH 2/3] Use the counted_by atribute info in builtin object size [PR108896]

2023-10-05 Thread Siddhesh Poyarekar
On 2023-08-25 11:24, Qing Zhao wrote: Use the counted_by atribute info in builtin object size to compute the subobject size for flexible array members. gcc/ChangeLog: PR C/108896 * tree-object-size.cc (addr_object_size): Use the counted_by attribute info. * tr

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

2023-10-05 Thread Siddhesh Poyarekar
On 2023-08-25 11:24, Qing Zhao wrote: This is the 3rd version of the patch, per our discussion based on the review comments for the 1st and 2nd version, the major changes in this version are: Hi Qing, I hope the review was helpful. Overall, a couple of things to consider: 1. How would you ha

[committed] hppa: Delete MALLOC_ABI_ALIGNMENT define from pa32-linux.h

2023-10-05 Thread John David Anglin
In spite of what the comment says, the MALLOC_ALIGNMENT in glibc for 32-bit hppa-linux has always been 8, not 16. There is no reason to increase it as the old linux threads implementation has been removed. So, we can use default in pa.h. Dave --- Delete MALLOC_ABI_ALIGNMENT define from pa32-lin

Re: [PATCH]AArch64 Add SVE implementation for cond_copysign.

2023-10-05 Thread Richard Sandiford
Tamar Christina writes: >> -Original Message- >> From: Richard Sandiford >> Sent: Thursday, October 5, 2023 8:29 PM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw >> ; Marcus Shawcroft >> ; Kyrylo Tkachov >> Subject: Re: [PATCH]AArch64 Add SVE implementatio

  1   2   >