Re: [PATCH v2] testsuite: Adjust switch-exp-transform-3.c for 32bit

2024-07-31 Thread Filip Kastl
On Wed 2024-07-31 13:34:28, Jakub Jelinek wrote: > On Wed, Jul 31, 2024 at 01:32:06PM +0200, Filip Kastl wrote: > > Thanks for the feedback! Here is a second version of the patch. I've > > tested > > this version with > > > > make check RUNTESTFLAGS=&qu

[gcc r15-2434] testsuite: Adjust switch-exp-transform-3.c for 32bit

2024-07-31 Thread Filip Kastl via Gcc-cvs
https://gcc.gnu.org/g:f40fd85c32c9ab4849065d0d14cd5a7ad67619b8 commit r15-2434-gf40fd85c32c9ab4849065d0d14cd5a7ad67619b8 Author: Filip Kastl Date: Wed Jul 31 13:40:45 2024 +0200 testsuite: Adjust switch-exp-transform-3.c for 32bit 32bit x86 CPUs won't natively support the FFS

[PATCH v2] testsuite: Adjust switch-exp-transform-3.c for 32bit

2024-07-31 Thread Filip Kastl
On Wed 2024-07-31 12:18:34, Jakub Jelinek wrote: > On Wed, Jul 31, 2024 at 12:02:08PM +0200, Filip Kastl wrote: > > 32bit x86 CPUs won't natively support the FFS operation on a 64 bit > > type. Therefore, the switch-exp-transform-3.c test will always fail > > with a 32bit t

[PATCH] testsuite: Adjust switch-exp-transform-3.c for 32bit

2024-07-31 Thread Filip Kastl
that the exponential index transform is able to handle long long int. Signed-off-by: Filip Kastl --- .../gcc.target/i386/switch-exp-transform-3.c | 51 +-- 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/switch-exp-transform-3.c b

Re: [PATCH v2] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-30 Thread Filip Kastl
On Tue 2024-07-30 14:34:54, Richard Biener wrote: > On Tue, 30 Jul 2024, Filip Kastl wrote: > > > > > > Ah, I see you fix those up. Then 2.) is left - the final block. Iff > > > > > the final block needs adjustment you know there was a path from > > &g

[gcc r15-2416] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-30 Thread Filip Kastl via Gcc-cvs
https://gcc.gnu.org/g:2b3533cd871f62923e7a4f06a826f37bf0f35c5c commit r15-2416-g2b3533cd871f62923e7a4f06a826f37bf0f35c5c Author: Filip Kastl Date: Tue Jul 30 18:40:29 2024 +0200 gimple ssa: Teach switch conversion to optimize powers of 2 switches Sometimes a switch has case

Re: [PATCH v2] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-30 Thread Filip Kastl
> Meanwhile I'll look into source code of the rest of the switch conversion > pass. > Switch conversion pass inserts conditions similar to what I'm doing so someone > before me may have already solved how to properly fix dominators in this > situation. Oh nevermind. Switch conversion

Re: [PATCH v2] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-30 Thread Filip Kastl
default" isn't equivalent with "there is a path between default and final" even when we assume that the original idom of final_bb was switch_bb. Therefore I think we're back to searching for a nice way to test "there is a path between default and final". Maybe you can spot a flaw in my logic or maybe you see a solution I don't. Meanwhile I'll look into source code of the rest of the switch conversion pass. Switch conversion pass inserts conditions similar to what I'm doing so someone before me may have already solved how to properly fix dominators in this situation. Cheers, Filip Kastl

Re: [PATCH v2] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-29 Thread Filip Kastl
Bs |default BB \ | / |/ final BB <- pred BB -+ | Here no predecessors of final_bb are dominated by default_bb but at the same time there does exist a path from default_bb to final_bb. Or is this CFG impossible for some reason? Btw to further check that we're on the sa

Re: [PATCH][contrib]: support json output from check_GNU_style_lib.py

2024-07-24 Thread Filip Kastl
> +else: > +json_string = json.dumps(result) > +print(json_string) > +exit(1) > else: > assert False Sure, this looks nice. I'm not sure if I have the right to approve the patch though. Cheers, Filip Kastl

Re: [PATCH][contrib]: support json output from check_GNU_style_lib.py

2024-07-22 Thread Filip Kastl
errlines.append({"file": locs[0], "row": locs[1], "column": locs[2], "err": e.console_error}) Cheers, Filip Kastl

Re: [PATCH v2] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-18 Thread Filip Kastl
On Thu 2024-07-18 12:07:42, Richard Biener wrote: > On Wed, 17 Jul 2024, Filip Kastl wrote: > > > > + } > > > > + > > > > + vec v; > > > > + v.create (1); > > > > + v.quick_push (m_final_bb);

[PATCH v2] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-17 Thread Filip Kastl
B \ | / / final BB / |/ Here idom(final BB) == switch BB. After the index exponential transform the CFG looks like this cond BB -+ | | switch BB ---+ | / | \ \ | case BBsdefault BB \ | / / final BB / |/ It still holds that idom(final

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-16 Thread Filip Kastl
On Wed 2024-07-10 11:34:44, Richard Biener wrote: > On Mon, 8 Jul 2024, Filip Kastl wrote: > > > Hi, > > > > I'm replying to Richard and keeping Andrew in cc since your suggestions > > overlap. > > > > > > On Tue 2024-06-11 14:48:06, Richard Bien

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-11 Thread Filip Kastl
out the can_ and gen_ functions as you suggested. I'm still a bit unsure what your vision of these is so before I submit all the changes I made to the patch as version 2 I would like to share how I implemented the functions (see bellow). Is this how you imagined the functions? Would you chang

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-08 Thread Filip Kastl
Hi, I'm replying to Richard and keeping Andrew in cc since your suggestions overlap. On Tue 2024-06-11 14:48:06, Richard Biener wrote: > On Thu, 30 May 2024, Filip Kastl wrote: > > +/* { dg-do compile } */ > > +/* { dg-options "-O2 -fdump-tree-switchconv -march=znver3&quo

[COMMITED] MAINTAINERS: Fix order in DCO

2024-07-05 Thread Filip Kastl
Hi, I've noticed wrong order in the Contributing under the DCO section of the MAINTAINERS file. I'm commiting the fix as obvious. Filip Kastl -- 8< -- ChangeLog: * MAINTAINERS: Fix order in Contributing under the DCO. Signed-off-by: Filip Kastl --- MAINTAINERS | 2 +- 1 f

[gcc r15-1862] MAINTAINERS: Fix order in DCO

2024-07-05 Thread Filip Kastl via Gcc-cvs
https://gcc.gnu.org/g:4da5dc4be81b2797943fea44b0d40ac04700baee commit r15-1862-g4da5dc4be81b2797943fea44b0d40ac04700baee Author: Filip Kastl Date: Fri Jul 5 15:17:58 2024 +0200 MAINTAINERS: Fix order in DCO ChangeLog: * MAINTAINERS: Fix order in Contributing

[PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-05-30 Thread Filip Kastl
on where I removed the check that the target has the POPCOUNT and FFS instructions so that the transformation would be triggered more often. That testing also went well. Are there any things I should tweak? Or is the patch ready to be applied? Cheers, Filip Kastl -- 8< -- Sometimes

[gcc r15-479] MAINTAINERS: Fix an entry using spaces instead of tabs

2024-05-14 Thread Filip Kastl via Gcc-cvs
https://gcc.gnu.org/g:1a809280929fac9836ff31dcc0980ac8acee7631 commit r15-479-g1a809280929fac9836ff31dcc0980ac8acee7631 Author: Filip Kastl Date: Tue May 14 10:34:12 2024 +0200 MAINTAINERS: Fix an entry using spaces instead of tabs In the MAINTAINERS file, names and emails

[COMMITED] MAINTAINERS: Fix an entry using spaces instead of tabs

2024-05-14 Thread Filip Kastl
: * MAINTAINERS: Use tabs between name and email. contrib/ChangeLog: * check-MAINTAINERS.py: Add warning about not using tabs. Signed-off-by: Filip Kastl --- MAINTAINERS | 2 +- contrib/check-MAINTAINERS.py | 8 2 files changed, 9 insertions(+), 1 deletion(-) diff

Re: How to format code in GCC style?

2024-04-30 Thread Filip Kastl
run it through check_GNU_style.sh. This works fine for me. Cheers, Filip Kastl

[gcc r14-9932] contrib/check-params-in-docs.py: Ignore target-specific params

2024-04-12 Thread Filip Kastl via Gcc-cvs
https://gcc.gnu.org/g:e30e760b51b108786946e04a26e92531762b022d commit r14-9932-ge30e760b51b108786946e04a26e92531762b022d Author: Filip Kastl Date: Fri Apr 12 09:52:27 2024 +0200 contrib/check-params-in-docs.py: Ignore target-specific params contrib/check-params-in-docs.py

[PATCH] contrib/check-params-in-docs.py: Ignore target-specific params

2024-04-12 Thread Filip Kastl
e script was just set to ignore aarch64 and gcn params which solved this issue only for x86. This patch sets the script to ignore all target-specific params. contrib/ChangeLog: * check-params-in-docs.py: Ignore target specific params. Signed-off-by: Filip Kastl --- contrib/check-params-

[COMMITED] MAINTAINERS: Fix order in Write After Aproval

2024-03-12 Thread Filip Kastl
Hi, I pushed this patch on Fri 8th and sent this mail to notify that I did so. I had some trouble with sending the mail though and it didn't arrive to the mailing list. I'm sending it now instead. Filip Kastl -- 8< -- ChangeLog: * MAINTAINERS: Fix order of names in Write Af

[gcc r14-9383] MAINTAINERS: Fix order in Write After Aproval

2024-03-08 Thread Filip Kastl via Gcc-cvs
https://gcc.gnu.org/g:1329dacdc0fbe7d43550294fe8b0323a6dc5ce9e commit r14-9383-g1329dacdc0fbe7d43550294fe8b0323a6dc5ce9e Author: Filip Kastl Date: Fri Mar 8 09:14:44 2024 +0100 MAINTAINERS: Fix order in Write After Aproval ChangeLog: * MAINTAINERS: Fix order

[COMMITED] contrib: Update test_mklog to correspond to mklog

2024-03-07 Thread Filip Kastl
Hi, the recent change to contrib/mklog.py broke contrib/test_mklog.py. It modified mklog.py to produce "Move to..." instead of "Moved to..." note in changelog for files that were moved. I've commited the fix as obvious. Filip Kastl -- 8< -- contrib/ChangeLog:

[gcc r14-9358] contrib: Update test_mklog to correspond to mklog

2024-03-07 Thread Filip Kastl via Gcc-cvs
https://gcc.gnu.org/g:0c1ff8951c2f5ff5b0699bbfa7523f690deac713 commit r14-9358-g0c1ff8951c2f5ff5b0699bbfa7523f690deac713 Author: Filip Kastl Date: Thu Mar 7 13:23:49 2024 +0100 contrib: Update test_mklog to correspond to mklog contrib/ChangeLog: * test_mklog.py

Re: [PATCH v4] A new copy propagation and PHI elimination pass

2023-12-14 Thread Filip Kastl
Successfully bootstrapped and regtested on x86_64-linux. Will push to master. Filip

[PATCH v4] A new copy propagation and PHI elimination pass

2023-12-13 Thread Filip Kastl
nt commit. Once that is successfully done, is the pass OK to be pushed to main? Filip -- >8 -- This patch adds the strongly-connected copy propagation (SCCOPY) pass. It is a lightweight GIMPLE copy propagation pass that also removes some redundant PHI statements. It handles degenerate PHIs, e.g.: _5 =

[PATCH v3] A new copy propagation and PHI elimination pass

2023-12-08 Thread Filip Kastl
_10>; _9 = PHI <_8, _10>; _10 = PHI <_8, _9, _1>; // Replaces occurences of _8, _9 and _10 by _1 gcc/ChangeLog: * Makefile.in: Added sccopy pass. * passes.def: Added sccopy pass before LTO streaming and before RTL expanstion. * tree-pass.h (make_pa

Re: [PATCH v2] A new copy propagation and PHI elimination pass

2023-11-22 Thread Filip Kastl
Hi Richard, > Can you name the new file gimple-ssa-sccopy.cc please? Yes, no problem. Btw, I thought that it is standard that gimple ssa passes have the tree-ssa- prefix. Do I understand it correctly that this is not true and many tree-ssa-*.cc passes should actually be named gimple-ssa-*.cc

[PING] [PATCH v2] A new copy propagation and PHI elimination pass

2023-11-15 Thread Filip Kastl
- Forwarded message from Filip Kastl - From: Filip Kastl To: gcc-patches@gcc.gnu.org Cc: rguent...@suse.de, hubi...@ucw.cz Subject: [PATCH v2] A new copy propagation and PHI elimination pass Date: Thu, 2 Nov 2023 14:00:02 +0100 Message-ID: > Hi, > > this is a patch that I

[PATCH v2] A new copy propagation and PHI elimination pass

2023-11-02 Thread Filip Kastl
c testcase so that it works as intended with other changes from the patch. The pr79691.c testcase checks that we get constants from snprintf calls and that they simplify into a single constant. The testcase doesn't account for the fact that this constant may be further copy propagated which is exact

Re: [PATCH] A new copy propagation and PHI elimination pass

2023-11-02 Thread Filip Kastl
Hi, thanks for the guidance. I'm going to post a new version of the patch with the testcase modified so that it searches for 'return 9;' instead of '= 9;'. Filip Kastl On Fri 2023-10-27 13:55:37, Jeff Law wrote: > > > On 10/20/23 07:52, Filip Kastl wrote: > > On Fri 2023

Re: [PATCH] A new copy propagation and PHI elimination pass

2023-10-20 Thread Filip Kastl
On Fri 2023-10-20 15:50:25, Filip Kastl wrote: > Bootstraped and tested* on x86_64-pc-linux-gnu. > > * One testcase (pr79691.c) did regress. However that is because the test is > dependent on a certain variable not being copy propagated. I will go into more > detail about

[PATCH] A new copy propagation and PHI elimination pass

2023-10-20 Thread Filip Kastl
cc.dg/sccopy-1.c: New test. Signed-off-by: Filip Kastl --- gcc/Makefile.in | 1 + gcc/passes.def | 3 + gcc/testsuite/gcc.dg/sccopy-1.c | 78 +++ gcc/tree-pass.h | 1 + gcc/tree-ssa-sccopy.cc | 867 ++

Re: [RFC] gimple ssa: SCCP - A new PHI optimization pass

2023-09-01 Thread Filip Kastl
> That's interesting. Your placement at > > NEXT_PASS (pass_cd_dce, false /* update_address_taken_p */); > NEXT_PASS (pass_phiopt, true /* early_p */); > + NEXT_PASS (pass_sccp); > > and > >NEXT_PASS (pass_tsan); >NEXT_PASS (pass_dse, true /* use DR

Re: [RFC] gimple ssa: SCCP - A new PHI optimization pass

2023-08-31 Thread Filip Kastl
> The most obvious places would be right after SSA construction and before RTL > expansion. > Can you provide measurements for those positions? The algorithm should only remove PHIs that break SSA form minimality. Since GCC's SSA construction already produces minimal SSA form, the algorithm

[RFC] gimple ssa: SCCP - A new PHI optimization pass

2023-08-24 Thread Filip Kastl
ses these functions. Signed-off-by: Filip Kastl gcc/ChangeLog: * Makefile.in: Added sccp pass. * passes.def: Added sccp pass to early and late optimizations. * tree-pass.h (make_pass_sccp): Added sccp pass. * tree-ssa-propagate.cc (cleanup_after_replace): New funct

[PATCH] value-prof.cc: Correct edge prob calculation.

2023-06-15 Thread Filip Kastl via Gcc-patches
-by: Filip Kastl --- gcc/value-prof.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/value-prof.cc b/gcc/value-prof.cc index f40e58ac4f2..580d6dd648d 100644 --- a/gcc/value-prof.cc +++ b/gcc/value-prof.cc @@ -1186,7 +1186,11 @@ gimple_mod_subtract_transform

[COMMITED] MAINTAINERS: Add myself to write after approval

2023-06-14 Thread Filip Kastl via Gcc-patches
Victor Kaplansky +Filip Kastl Geoffrey Keating Brendan Kehoe Andi Kleen -- 2.40.1