Re: [PATCH] [RFC] Target-independent store forwarding avoidance. [PR48696] Target-independent store forwarding avoidance.

2024-05-30 Thread Manolis Tsamis
On Fri, May 24, 2024 at 9:27 AM Richard Biener wrote: > > On Thu, 23 May 2024, Manolis Tsamis wrote: > > > This pass detects cases of expensive store forwarding and tries to avoid > > them > > by reordering the stores and using suitable bit insertion sequences. >

[PING] [PATCH v4 2/3] [RFC] ifcvt: Allow more operations in multiple set if conversion

2024-06-03 Thread Manolis Tsamis
et/aarch64/ifcvt_multiple_sets_arithm.c: New test. Signed-off-by: Manolis Tsamis --- Changes in v4: - Remove unnecessary hardcoded list of allowed ops in bb_ok_for_noce_convert_multiple_sets. - Set need_cmov based on BB live_out instead of REG_DEAD notes. - Fix preexisting issues and i

[PING] [PATCH v4 0/3] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets

2024-06-03 Thread Manolis Tsamis
unnecessary hardcoded list of allowed ops in bb_ok_for_noce_convert_multiple_sets. - Set need_cmov based on BB live_out instead of REG_DEAD notes. - Fix preexisting issues and improve the code that sets read_comparison. Manolis Tsamis (3): [RFC] ifcvt: handle sequences that

[PING] [PATCH v4 1/3] [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-06-03 Thread Manolis Tsamis
bbers): Use modified_in_p instead. (noce_convert_multiple_sets_1): Don't use seq2 if it clobbers cc_cmp. Refactor the code that sets read_comparison. Signed-off-by: Manolis Tsamis --- (no changes since v1) gcc/ifcvt.cc | 106 -

[PING] [PATCH v4 3/3] [RFC] ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets

2024-06-03 Thread Manolis Tsamis
(struct noce_multiple_sets_info): Introduce new struct noce_multiple_sets_info to store info for noce_convert_multiple_sets. gcc/testsuite/ChangeLog: * gcc.target/aarch64/ifcvt_multiple_sets_rewire.c: New test. Signed-off-by: Manolis Tsamis --- (no changes since v1) gcc/ifcvt.cc

[PATCH] Rearrange SLP nodes with duplicate statements. [PR98138]

2024-06-04 Thread Manolis Tsamis
-off-by: Manolis Tsamis --- .../aarch64/vect-slp-two-operator.c | 42 gcc/tree-vect-slp.cc | 234 ++ 2 files changed, 276 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/vect-slp-two-operator.c diff --git a/gcc/testsuite

[PATCH v5] Target-independent store forwarding avoidance.

2024-08-09 Thread Manolis Tsamis
. * gcc.target/aarch64/avoid-store-forwarding-3.c: New test. * gcc.target/aarch64/avoid-store-forwarding-4.c: New test. * gcc.target/aarch64/avoid-store-forwarding-5.c: New test. Signed-off-by: Manolis Tsamis --- Changes in v5: - Fix bug with BIG_ENDIAN targets

[PATCH] ifcvt: Fix force_operand ICE due to noce_convert_multiple_sets [PR116353]

2024-08-13 Thread Manolis Tsamis
: Manolis Tsamis --- gcc/ifcvt.cc | 6 ++- gcc/testsuite/gcc.target/i386/pr116353.c | 55 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr116353.c diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc

[PATCH] ifcvt: Do not overwrite results in noce_convert_multiple_sets [PR116372, PR116405]

2024-08-20 Thread Manolis Tsamis
372.c: New test. * gcc.dg/pr116405.c: New test. Signed-off-by: Manolis Tsamis --- gcc/ifcvt.cc| 22 ++ gcc/testsuite/gcc.dg/pr116372.c | 13 + gcc/testsuite/gcc.dg/pr116405.c | 17 + 3 files changed, 48 insertions(+), 4

Re: [PATCH] ifcvt: Fix force_operand ICE due to noce_convert_multiple_sets [PR116353]

2024-08-21 Thread Manolis Tsamis
On Tue, Aug 13, 2024 at 10:48 PM Jeff Law wrote: > > > > On 8/13/24 5:57 AM, Manolis Tsamis wrote: > > Now that more operations are allowed for noce_convert_multiple_sets, we > > need to > > check noce_can_force_operand on the sequence before calling > >

[PATCH] ifcvt: Disallow emitting call instructions in noce_convert_multiple_sets [PR116358]

2024-08-22 Thread Manolis Tsamis
vt.cc (noce_convert_multiple_sets): Disallow call insns. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr116358.c: New test. Signed-off-by: Manolis Tsamis --- gcc/ifcvt.cc| 2 +- gcc/testsuite/gcc.target/aarch64/pr116358.c | 15 +++ 2 files changed, 16 insertions(

Re: [PATCH v5] Target-independent store forwarding avoidance.

2024-08-29 Thread Manolis Tsamis
Hi Richard, Thanks a lot for the extensive review and useful suggestions (and sorry for the late reply). I have implemented most of these for a next version, so let me address your individual comments below: On Fri, Aug 16, 2024 at 5:33 PM Richard Sandiford wrote: > > Manolis Tsamis

Re: [PATCH v4 1/3] [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-06-05 Thread Manolis Tsamis
On Wed, Jun 5, 2024 at 2:00 PM Richard Sandiford wrote: > > Sorry for the slow review. > > Manolis Tsamis writes: > > This is an extension of what was done in PR106590. > > > > Currently if a sequence generated in noce_convert_multiple_sets clobbers the > >

[PATCH v2] Target-independent store forwarding avoidance.

2024-06-06 Thread Manolis Tsamis
-2.c: New test. * gcc.target/aarch64/avoid-store-forwarding-3.c: New test. * gcc.target/aarch64/avoid-store-forwarding-4.c: New test. Signed-off-by: Manolis Tsamis --- Changes in v2: - Allow modes that are not scalar_int_mode. - Introduce simple costing to avoid

Re: [PATCH] [RFC] Target-independent store forwarding avoidance. [PR48696] Target-independent store forwarding avoidance.

2024-06-06 Thread Manolis Tsamis
On Fri, May 24, 2024 at 9:27 AM Richard Biener wrote: > > On Thu, 23 May 2024, Manolis Tsamis wrote: > > > This pass detects cases of expensive store forwarding and tries to avoid > > them > > by reordering the stores and using suitable bit insertion sequences. >

Re: [PATCH v2] Target-independent store forwarding avoidance.

2024-06-10 Thread Manolis Tsamis
On Sat, Jun 8, 2024 at 1:31 AM Jeff Law wrote: > > > > On 6/6/24 4:10 AM, Manolis Tsamis wrote: > > This pass detects cases of expensive store forwarding and tries to avoid > > them > > by reordering the stores and using suitable bit insertion sequences. > &g

Re: [PATCH v2] Target-independent store forwarding avoidance.

2024-06-10 Thread Manolis Tsamis
On Sun, Jun 9, 2024 at 5:29 PM Jeff Law wrote: > > > > On 6/7/24 4:31 PM, Jeff Law wrote: > > > > > I've actually added it to my tester just to see if there's any fallout. > > It'll take a week to churn through the long running targets that > > bootstrap in QEMU, but the crosses should have data M

Re: [PATCH] Rearrange SLP nodes with duplicate statements. [PR98138]

2024-06-10 Thread Manolis Tsamis
On Wed, Jun 5, 2024 at 11:07 AM Richard Biener wrote: > > On Tue, 4 Jun 2024, Manolis Tsamis wrote: > > > This change adds a function that checks for SLP nodes with multiple > > occurrences > > of the same statement (e.g. {A, B, A, B, ...}) and tries to rearrange the

Re: [PATCH v2] Target-independent store forwarding avoidance.

2024-06-12 Thread Manolis Tsamis
On Mon, Jun 10, 2024 at 9:27 PM Philipp Tomsich wrote: > > On Mon, 10 Jun 2024 at 20:03, Jeff Law wrote: > > > > > > > > On 6/10/24 1:55 AM, Manolis Tsamis wrote: > > > > >> > > > There was an older submission of a load-pair specific pass

[PATCH v3] Target-independent store forwarding avoidance.

2024-06-13 Thread Manolis Tsamis
-2.c: New test. * gcc.target/aarch64/avoid-store-forwarding-3.c: New test. * gcc.target/aarch64/avoid-store-forwarding-4.c: New test. * gcc.target/aarch64/avoid-store-forwarding-5.c: New test. Signed-off-by: Manolis Tsamis --- Changes in v3: - Only emit SUBREG

Re: [PATCH v2] Target-independent store forwarding avoidance.

2024-06-13 Thread Manolis Tsamis
On Sun, Jun 9, 2024 at 5:29 PM Jeff Law wrote: > > > > On 6/7/24 4:31 PM, Jeff Law wrote: > > > > > I've actually added it to my tester just to see if there's any fallout. > > It'll take a week to churn through the long running targets that > > bootstrap in QEMU, but the crosses should have data M

[PATCH v2] Rearrange SLP nodes with duplicate statements. [PR98138]

2024-06-26 Thread Manolis Tsamis
=98138 gcc/ChangeLog: * tree-vect-slp.cc: Avoid duplicates in two_operators nodes. gcc/testsuite/ChangeLog: * gcc.target/aarch64/vect-slp-two-operator.c: New test. Signed-off-by: Manolis Tsamis --- Changes in v2: - Do not use predefined patterns; support rearrangement of

Re: [PATCH v2] Rearrange SLP nodes with duplicate statements. [PR98138]

2024-06-26 Thread Manolis Tsamis
n 26, 2024 at 3:06 PM Manolis Tsamis wrote: > > This change checks when a two_operators SLP node has multiple occurrences of > the same statement (e.g. {A, B, A, B, ...}) and tries to rearrange the > operands > so that there are no duplicates. Two vec_perm expressions are then introdu

Re: [PATCH] Rearrange SLP nodes with duplicate statements. [PR98138]

2024-06-26 Thread Manolis Tsamis
On Wed, Jun 5, 2024 at 11:07 AM Richard Biener wrote: > > On Tue, 4 Jun 2024, Manolis Tsamis wrote: > > > This change adds a function that checks for SLP nodes with multiple > > occurrences > > of the same statement (e.g. {A, B, A, B, ...}) and tries to rearrange the

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

2024-07-26 Thread Manolis Tsamis
-related bug when SEQ modifies COND. Manolis Tsamis (3): [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets [RFC] ifcvt: Allow more operations in multiple set if conversion [RFC] ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets gcc

[PATCH v5 2/3] [RFC] ifcvt: Allow more operations in multiple set if conversion

2024-07-26 Thread Manolis Tsamis
et/aarch64/ifcvt_multiple_sets_arithm.c: New test. Signed-off-by: Manolis Tsamis --- Changes in v5: - Loop over SEQ and check modified_in_p for all instructions. - Fix x86-related bug when SEQ modifies COND. gcc/ifcvt.cc | 34 +++- .../aarch64/ifcvt_multiple_set

[PATCH v5 3/3] [RFC] ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets

2024-07-26 Thread Manolis Tsamis
(struct noce_multiple_sets_info): Introduce new struct noce_multiple_sets_info to store info for noce_convert_multiple_sets. gcc/testsuite/ChangeLog: * gcc.target/aarch64/ifcvt_multiple_sets_rewire.c: New test. Signed-off-by: Manolis Tsamis --- (no changes since v1) gcc/ifcvt.cc

[PATCH v5 1/3] [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-07-26 Thread Manolis Tsamis
f the if_then_else emitted more robust. gcc/ChangeLog: * ifcvt.cc (check_for_cc_cmp_clobbers): Use modified_in_p instead. (noce_convert_multiple_sets_1): Don't use seq2 if it clobbers cc_cmp. Punt if seq clobbers cond. Refactor the code that sets read_comparison. Signed-off-b

Re: [PING] [PATCH v4 1/3] [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-07-26 Thread Manolis Tsamis
On Thu, Jul 11, 2024 at 1:03 AM Jeff Law wrote: > > > > On 6/3/24 5:34 AM, Manolis Tsamis wrote: > > This is an extension of what was done in PR106590. > > > > Currently if a sequence generated in noce_convert_multiple_sets clobbers the > > condition rtx (cc_

Re: [PATCH v4 1/3] [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-07-26 Thread Manolis Tsamis
On Wed, Jun 5, 2024 at 2:00 PM Richard Sandiford wrote: > > Sorry for the slow review. > > Manolis Tsamis writes: > > This is an extension of what was done in PR106590. > > > > Currently if a sequence generated in noce_convert_multiple_sets clobbers the > >

[RESEND PATCH v5 1/3] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-07-26 Thread Manolis Tsamis
f the if_then_else emitted more robust. gcc/ChangeLog: * ifcvt.cc (check_for_cc_cmp_clobbers): Use modified_in_p instead. (noce_convert_multiple_sets_1): Don't use seq2 if it clobbers cc_cmp. Punt if seq clobbers cond. Refactor the code that sets read_comparison. Signed-off-b

[RESEND PATCH v5 0/3] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets

2024-07-26 Thread Manolis Tsamis
SEQ and check modified_in_p for all instructions. - Fix x86-related bug when SEQ modifies COND. Manolis Tsamis (3): ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets ifcvt: Allow more operations in multiple set if conversion ifcvt: Handle multiple rewired

[RESEND PATCH v5 2/3] ifcvt: Allow more operations in multiple set if conversion

2024-07-26 Thread Manolis Tsamis
et/aarch64/ifcvt_multiple_sets_arithm.c: New test. Signed-off-by: Manolis Tsamis --- Changes in v5: - Loop over SEQ and check modified_in_p for all instructions. - Fix x86-related bug when SEQ modifies COND. gcc/ifcvt.cc | 34 +++- .../aarch64/ifcvt_multiple_set

[RESEND PATCH v5 3/3] ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets

2024-07-26 Thread Manolis Tsamis
(struct noce_multiple_sets_info): Introduce new struct noce_multiple_sets_info to store info for noce_convert_multiple_sets. gcc/testsuite/ChangeLog: * gcc.target/aarch64/ifcvt_multiple_sets_rewire.c: New test. Signed-off-by: Manolis Tsamis --- (no changes since v1) gcc/ifcvt.cc

Re: [PATCH v2] Rearrange SLP nodes with duplicate statements. [PR98138]

2024-08-06 Thread Manolis Tsamis
Pinging this for a review and/or further feedback. Thanks, Manolis On Wed, Jun 26, 2024 at 3:06 PM Manolis Tsamis wrote: > > This change checks when a two_operators SLP node has multiple occurrences of > the same statement (e.g. {A, B, A, B, ...}) and tries to rearrange the > o

Re: [RESEND PATCH v5 1/3] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-08-07 Thread Manolis Tsamis
s no change needed for that comment. > I can't comment on ifcvt changes to say if they're OK or not otherwise, > sorry. > > > > > Thanks, > > Philipp. > > > > > > On Fri, 26 Jul 2024 at 12:50, Sam James wrote: > >> > >> Mano

[PATCH] MATCH: Maybe expand (T)(A + C1) * C2 and (T)(A + C1) * C2 + C3 [PR109393]

2024-04-23 Thread Manolis Tsamis
ned-off-by: Manolis Tsamis --- gcc/match.pd| 30 ++ gcc/testsuite/gcc.dg/pr109393.c | 16 2 files changed, 46 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr109393.c diff --git a/gcc/match.pd b/gcc/match.pd index d401e7503e6..1

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

2024-04-23 Thread Manolis Tsamis
unnecessary hardcoded list of allowed ops in bb_ok_for_noce_convert_multiple_sets. - Set need_cmov based on BB live_out instead of REG_DEAD notes. - Fix preexisting issues and improve the code that sets read_comparison. Manolis Tsamis (3): [RFC] ifcvt: handle sequences that

[PATCH v4 1/3] [RFC] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-04-23 Thread Manolis Tsamis
bbers): Use modified_in_p instead. (noce_convert_multiple_sets_1): Don't use seq2 if it clobbers cc_cmp. Refactor the code that sets read_comparison. Signed-off-by: Manolis Tsamis --- (no changes since v1) gcc/ifcvt.cc | 106 -

[PATCH v4 3/3] [RFC] ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets

2024-04-23 Thread Manolis Tsamis
(struct noce_multiple_sets_info): Introduce new struct noce_multiple_sets_info to store info for noce_convert_multiple_sets. gcc/testsuite/ChangeLog: * gcc.target/aarch64/ifcvt_multiple_sets_rewire.c: New test. Signed-off-by: Manolis Tsamis --- (no changes since v1) gcc/ifcvt.cc

[PATCH v4 2/3] [RFC] ifcvt: Allow more operations in multiple set if conversion

2024-04-23 Thread Manolis Tsamis
et/aarch64/ifcvt_multiple_sets_arithm.c: New test. Signed-off-by: Manolis Tsamis --- Changes in v4: - Remove unnecessary hardcoded list of allowed ops in bb_ok_for_noce_convert_multiple_sets. - Set need_cmov based on BB live_out instead of REG_DEAD notes. - Fix preexisting issues and i

Re: [PATCH v3 1/4] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2024-04-23 Thread Manolis Tsamis
On Thu, Oct 19, 2023 at 10:41 PM Richard Sandiford wrote: > > Manolis Tsamis writes: > > This is an extension of what was done in PR106590. > > > > Currently if a sequence generated in noce_convert_multiple_sets clobbers the > > condition rtx (cc_cmp or rev_

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

2024-04-23 Thread Manolis Tsamis
On Thu, Oct 19, 2023 at 10:46 PM Richard Sandiford wrote: > > Manolis Tsamis writes: > > Currently the operations allowed for if conversion of a basic block with > > multiple sets are few, namely REG, SUBREG and CONST_INT (as controlled by > > bb_ok_for_noce_convert_mult

Re: [PATCH v2] ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets

2024-04-23 Thread Manolis Tsamis
On Thu, Nov 23, 2023 at 11:01 PM Richard Sandiford wrote: > > Manolis Tsamis writes: > > The existing implementation of need_cmov_or_rewire and > > noce_convert_multiple_sets_1 assumes that sets are either REG or SUBREG. > > This commit enchances them so they can han

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

2024-04-30 Thread Manolis Tsamis
On Thu, Apr 25, 2024 at 2:40 AM Hans-Peter Nilsson wrote: > > On Tue, 23 Apr 2024, Manolis Tsamis wrote: > > diff --git a/gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_arithm.c > > b/gcc/testsuite/gcc.target/aarch64/ifcvt_multiple_sets_arithm.c > ... > > +/*

Re: [PATCH] MATCH: Maybe expand (T)(A + C1) * C2 and (T)(A + C1) * C2 + C3 [PR109393]

2024-05-02 Thread Manolis Tsamis
On Thu, May 2, 2024 at 4:00 PM Richard Biener wrote: > > On Tue, 23 Apr 2024, Manolis Tsamis wrote: > > > The original motivation for this pattern was that the following function > > does > > not fold to 'return 1': > > > > int foo(int *a, int j

[RFC PATCH] Do not cache SLP trees across SLP instances [PR116352]

2024-08-30 Thread Manolis Tsamis
map per SLP instance. gcc/testsuite/ChangeLog: * gcc.dg/pr116352.c: New test. Signed-off-by: Manolis Tsamis --- gcc/testsuite/gcc.dg/pr116352.c | 18 ++ gcc/tree-vect-slp.cc| 12 +++- 2 files changed, 25 insertions(+), 5 deletions(-) create

Re: [RFC PATCH] Do not cache SLP trees across SLP instances [PR116352]

2024-08-30 Thread Manolis Tsamis
h the code, this looked like a general issue to me and hence I'm proposing this fix. Thanks, Manolis On Fri, Aug 30, 2024 at 1:46 PM Manolis Tsamis wrote: > > Currently we do SLP CSE after permute optimization using a single map across > all SLP instances. These SLP instances c

Re: [PATCH v5] Target-independent store forwarding avoidance.

2024-08-30 Thread Manolis Tsamis
On Thu, Aug 29, 2024 at 9:16 PM Richard Sandiford wrote: > > Manolis Tsamis writes: > > On Fri, Aug 16, 2024 at 5:33 PM Richard Sandiford > > wrote: > >> Manolis Tsamis writes: > >> > +} > >> > + > >> > + virtual

Re: [RFC PATCH] Do not cache SLP trees across SLP instances [PR116352]

2024-08-30 Thread Manolis Tsamis
On Fri, Aug 30, 2024 at 2:24 PM Richard Biener wrote: > > On Fri, 30 Aug 2024, Manolis Tsamis wrote: > > > For more context please see > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116352#c11. > > > > I've sent this as an RFC because it's hard to be s

Re: [RFC PATCH] ipa-cp: Speculatively call specialized functions

2022-11-14 Thread Manolis Tsamis
ble): Likewise. > > (ipa_fn_summary_t::duplicate): Likewise. > > (analyze_function_body): Likewise. > > (estimate_edge_size_and_time): Likewise. > > (remap_edge_summaries): Likewise. > > * ipa-inline-transform.cc (inline

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-16 Thread Manolis Tsamis
On Sun, Nov 13, 2022 at 3:33 AM Jeff Law via Gcc-patches wrote: > > > On 11/7/22 15:07, Palmer Dabbelt wrote: > > On Thu, 03 Nov 2022 15:23:28 PDT (-0700), j...@ventanamicro.com wrote: > >> > >> On 11/2/22 18:26, Palmer Dabbelt wrote: > >>> > > I also tried to remove that restriction but it lo

[PATCH v3] Enable shrink wrapping for the RISC-V target.

2022-11-17 Thread Manolis Tsamis
Signed-off-by: Manolis Tsamis gcc/ChangeLog: * config/riscv/riscv.cc (struct machine_function): Add array to store register wrapping information. (riscv_for_each_saved_reg): Skip registers that are wrapped separetely. (riscv_get_separate_components): New function

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-17 Thread Manolis Tsamis
On Thu, Nov 17, 2022 at 4:09 AM Jeff Law wrote: > > > On 11/16/22 03:26, Manolis Tsamis wrote: > > On Sun, Nov 13, 2022 at 3:33 AM Jeff Law via Gcc-patches > > wrote: > >> > >> On 11/7/22 15:07, Palmer Dabbelt wrote: > >>> On Thu, 03 Nov 202

Re: [PATCH v2] ipa-cp: Speculatively call specialized functions

2023-01-23 Thread Manolis Tsamis
On Fri, Jan 13, 2023 at 7:49 PM Martin Jambor wrote: > > Hello, > > sorry for getting to this quite late. I have only had a quick glance at > ipa-cp.cc hunks so far. > Hi Martin, Thanks for taking the time to review these. > On Fri, Dec 16 2022, Manolis Tsamis wrote

[PATCH v2] Add pattern to convert vector shift + bitwise and + multiply to vector compare in some cases.

2022-11-29 Thread Manolis Tsamis
cmp w2, w1 bhi .L20 The effect is similar for x86-64. Signed-off-by: Manolis Tsamis gcc/ChangeLog: * match.pd: Simplify vector shift + bit_and + multiply in some cases. gcc/testsuite/ChangeLog: * gcc.target/aarch64/swar_to_vec_cmp.c: New test

Re: [PATCH] Add pattern to convert vector shift + bitwise and + multiply to vector compare in some cases.

2022-11-29 Thread Manolis Tsamis
Hi all, based on everyone's comments I have sent a v2 of this patch that can be found here https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607472.html As per Richard's comments the pattern now uses vec_cond_expr instead and includes other fixes as requested. Also based on Tamar's suggest

Re: [PATCH v2] Add pattern to convert vector shift + bitwise and + multiply to vector compare in some cases.

2022-11-30 Thread Manolis Tsamis
On Wed, Nov 30, 2022 at 9:44 AM Richard Biener wrote: > > On Tue, Nov 29, 2022 at 11:05 AM Manolis Tsamis > wrote: > > > > When using SWAR (SIMD in a register) techniques a comparison operation > > within > > such a register can be made by using a combinatio

Re: [PATCH v2] Add pattern to convert vector shift + bitwise and + multiply to vector compare in some cases.

2022-12-06 Thread Manolis Tsamis
On Wed, Nov 30, 2022 at 9:44 AM Richard Biener wrote: > > On Tue, Nov 29, 2022 at 11:05 AM Manolis Tsamis > wrote: > > > > When using SWAR (SIMD in a register) techniques a comparison operation > > within > > such a register can be made by using a combinatio

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

2023-03-16 Thread Manolis Tsamis
. Signed-off-by: Manolis Tsamis --- gcc/tree-ssa-forwprop.cc | 41 +++- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc index e34f0888954..93d5043821b 100644 --- a/gcc/tree-ssa-forwprop.cc +++ b

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

2023-03-20 Thread Manolis Tsamis
On Fri, Mar 17, 2023 at 10:31 AM Richard Biener wrote: > > On Thu, Mar 16, 2023 at 4:27 PM Manolis Tsamis > wrote: > > > > For this C testcase: > > > > void g(); > > void f(unsigned int *a) > > { > > if (++*a == 1) > > g(); >

<    1   2