RE: [EXTERNAL] Check that passes do not forget to define profile

2023-08-30 Thread Eugene Rozenfeld via Gcc-patches
Hi Jan, These new checks are too strong for AutoFDO. For example, the edge probabilities are not guaranteed to be initialized (see afdo_calculate_branch_prob). This currently breaks autoprofiledbootstrap build. I suggest removing cfun->cfg->full_profile = true; from auto-profile.cc.

RE: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-07-05 Thread Eugene Rozenfeld via Gcc-patches
ing there isn't permitted/possible then I guess the patch is OK? Can you confirm? Thanks, Richard. > -Original Message- > From: Gcc-patches > On Behalf Of > Eugene Rozenfeld via Gcc-patches > Sent: Friday, June 30, 2023 2:44 PM > To: Sam James ; Richard Biener

RE: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-06-30 Thread Eugene Rozenfeld via Gcc-patches
I also set /proc/sys/kernel/perf_event_paranoid to 1 instead of the default 2. -Original Message- From: Gcc-patches On Behalf Of Eugene Rozenfeld via Gcc-patches Sent: Friday, June 30, 2023 2:44 PM To: Sam James ; Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: RE: [EXTERNAL] Re

RE: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-06-30 Thread Eugene Rozenfeld via Gcc-patches
and kernel events for autofdo tests and autoprofiledbootstrap [You don't often get email from s...@gentoo.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Richard Biener via Gcc-patches writes: > On Fri, Jun 30, 2023 at 7:28 AM Eugene Rozenfeld via

[PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

2023-06-29 Thread Eugene Rozenfeld via Gcc-patches
When we collect just user events for autofdo with lbr we get some events where branch sources are kernel addresses and branch targets are user addresses. Without kernel MMAP events create_gcov can't make sense of kernel addresses. Currently create_gcov fails if it can't map at least 95% of

[PATCH] Fix collection and processing of autoprofile data for target libs

2023-06-27 Thread Eugene Rozenfeld via Gcc-patches
cc1, cc1plus, and lto built during STAGEautoprofile need to be built with debug info since they are used to build target libs. -gtoggle was turning off debug info for this stage. create_gcov should be passed prev-gcc/cc1, prev-gcc/cc1plus, and prev-gcc/lto instead of stage1-gcc/cc1,

RE: [EXTERNAL] [PATCH] Update perf auto profile script

2023-06-05 Thread Eugene Rozenfeld via Gcc-patches
Ok for trunk. Thank you for updating this! Eugene -Original Message- From: Gcc-patches On Behalf Of Andi Kleen via Gcc-patches Sent: Tuesday, May 30, 2023 4:08 AM To: gcc-patches@gcc.gnu.org Cc: Andi Kleen Subject: [EXTERNAL] [PATCH] Update perf auto profile script - Fix

RE: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build

2023-05-17 Thread Eugene Rozenfeld via Gcc-patches
_CONFIGURE_FLAGS? >> >> Richard. >> >> > Thanks, >> > >> > Eugene >> > >> > -Original Message- >> > From: Richard Biener >> > Sent: Tuesday, May 9, 2023 11:40 PM >> > To: Eugene Rozenfeld

RE: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build

2023-05-12 Thread Eugene Rozenfeld via Gcc-patches
ugene Rozenfeld > Cc: gcc-patches@gcc.gnu.org > Subject: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings > during autoprofiledbootstrap build > > On Wed, May 10, 2023 at 3:38 AM Eugene Rozenfeld via Gcc-patches > wrote: > > > > autoprofiledbootstrap build

RE: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build

2023-05-10 Thread Eugene Rozenfeld via Gcc-patches
2023 11:40 PM To: Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build On Wed, May 10, 2023 at 3:38 AM Eugene Rozenfeld via Gcc-patches wrote: > > autoprofiledbootstrap build produces new warning

RE: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build

2023-05-10 Thread Eugene Rozenfeld via Gcc-patches
> I cannot find a call to this debug function on trunk. How exactly did this > trigger a warning? Here is the command during autoprofiledbootstrap build that resulted in a warning: ~/gcc1_objdir/gcc$ /home/erozen/gcc1_objdir/./prev-gcc/xg++ -B/home/erozen/gcc1_objdir/./prev-gcc/

[PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build

2023-05-09 Thread Eugene Rozenfeld via Gcc-patches
autoprofiledbootstrap build produces new warnings since inlining decisions are different from other builds. This patch contains fixes and workarounds for those warnings. Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * config/i386/i386-expand.cc (expand_vec_perm_interleave2): Work around

RE: [EXTERNAL] Re: [PATCH][PUSHED] Fix cfg maintenance after inlining in AutoFDO

2023-05-09 Thread Eugene Rozenfeld via Gcc-patches
r inlining in AutoFDO On Tue, May 9, 2023 at 12:27 AM Eugene Rozenfeld via Gcc-patches wrote: > > Todo from early_inliner needs to be propagated so that > cleanup_tree_cfg () is called if necessary. > > This bug was causing an assert in get_loop_body during ipa-sra in &g

[PATCH][PUSHED] Fix cfg maintenance after inlining in AutoFDO

2023-05-08 Thread Eugene Rozenfeld via Gcc-patches
Todo from early_inliner needs to be propagated so that cleanup_tree_cfg () is called if necessary. This bug was causing an assert in get_loop_body during ipa-sra in autoprofiledbootstrap build since loops weren't fixed up and one of the loops had num_nodes set to 0. Tested on

RE: [EXTERNAL] Re: [PATCH] Fix autoprofiledbootstrap build

2023-03-27 Thread Eugene Rozenfeld via Gcc-patches
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613974.html Thanks, Eugene -Original Message- From: Eugene Rozenfeld Sent: Tuesday, March 14, 2023 2:21 PM To: Jeff Law ; gcc-patches@gcc.gnu.org; Andi Kleen Subject: RE: [EXTERNAL] Re: [PATCH] Fix autoprofiledbootstrap

RE: [EXTERNAL] Re: [PATCH] Fix autoprofiledbootstrap build

2023-03-14 Thread Eugene Rozenfeld via Gcc-patches
Hi Jeff, I revived profile_merger tool in http://github.com/google/autofdo and re-worked the patch to merge profiles for compiling the libraries. Please take a look at the attached patch. Thanks, Eugene -Original Message- From: Jeff Law Sent: Tuesday, November 22, 2022 10:16 PM To:

RE: [EXTERNAL] Re: [PATCH] Fix count comparison in ipa-cp

2022-12-06 Thread Eugene Rozenfeld via Gcc-patches
on't often get email from jeffreya...@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] On 11/21/22 14:26, Eugene Rozenfeld via Gcc-patches wrote: > The existing comparison was incorrect for non-PRECISE counts (e.g., > AFDO): we could end up with a

RE: [EXTERNAL] Re: [PATCH] Fix autoprofiledbootstrap build

2022-11-22 Thread Eugene Rozenfeld via Gcc-patches
Rozenfeld ; gcc-patches@gcc.gnu.org; Andi Kleen Subject: [EXTERNAL] Re: [PATCH] Fix autoprofiledbootstrap build [You don't often get email from jeffreya...@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] On 11/21/22 14:57, Eugene Rozenfeld via Gcc

[PATCH] Fix autoprofiledbootstrap build

2022-11-21 Thread Eugene Rozenfeld via Gcc-patches
1. Fix gcov version 2. Don't attempt to create an autoprofile file for cc1 since cc1plus (not cc1) is not invoked when building cc1 3. Fix documentation typo Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * c/Make-lang.in: Don't attempt to create an autoprofile file for cc1 *

[PATCH] Fix count comparison in ipa-cp

2022-11-21 Thread Eugene Rozenfeld via Gcc-patches
The existing comparison was incorrect for non-PRECISE counts (e.g., AFDO): we could end up with a 0 base_count, which could lead to asserts, e.g., in good_cloning_opportunity_p. gcc/ChangeLog: * ipa-cp.cc (ipcp_propagate_stage): Fix profile count comparison. --- gcc/ipa-cp.cc | 2 +- 1

[PATCH][PUSHED] Don't force DWARF4 for AutoFDO tests

2022-10-25 Thread Eugene Rozenfeld via Gcc-patches
Support for DWARF5 was added to create_gcov in https://github.com/google/autofdo so we no longer need to force DWARF4 for AutoFDO tests. Tested on x86_64-pc-linux-gnu. gcc/testsuite/ChangeLog: * lib/profopt.exp: Don't force DWARF4 for AutoFDO tests --- gcc/testsuite/lib/profopt.exp | 2

[PATCH][PUSHED] Start using discriminators in AutoFDO

2022-10-25 Thread Eugene Rozenfeld via Gcc-patches
Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * auto-profile.cc (get_combined_location): Include discriminator in the returned combined location. (read_function_instance): Read discriminators from profiles. --- gcc/auto-profile.cc | 5 +++-- 1 file changed, 3

RE: [EXTERNAL] RE: [r13-3172 Regression] FAIL:libgomp.oacc-c../../libgomp.oacc-c-c..-common/kernels-loop-g.c -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -O2 (test for excess errors)

2022-10-17 Thread Eugene Rozenfeld via Gcc-patches
Yes, I received that one. The root cause is the -gstatement-frontiers issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100733 . I submitted a workaround patch for that ( https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603673.html ) but it hasn't been approved yet. Another workaround

RE: [EXTERNAL] Re: [PATCH] Don't print discriminators for -fcompare-debug.

2022-10-17 Thread Eugene Rozenfeld via Gcc-patches
: [EXTERNAL] Re: [PATCH] Don't print discriminators for -fcompare-debug. On Sun, Oct 16, 2022 at 10:25 PM Eugene Rozenfeld via Gcc-patches wrote: > > With -gstatement-frontiers we may end up with different IR coming from > the front end with and without debug information turned on. >

RE: [r13-3172 Regression] FAIL:libgomp.oacc-c../../libgomp.oacc-c-c..-common/kernels-loop-g.c -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -O2 (test for excess errors) on Linux/x86_64

2022-10-16 Thread Eugene Rozenfeld via Gcc-patches
That commit had a bug that was fixed in https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=80f414e6d73f9f1683f93d83ce63a6a482e54bee Was that fix included in your GCC build? From: Jiang, Haochen Sent: Sunday, October 16, 2022 8:09 PM To: gcc-patches@gcc.gnu.org; Eugene Rozenfeld ; Jiang, Haochen ;

[PATCH] Don't print discriminators for -fcompare-debug.

2022-10-16 Thread Eugene Rozenfeld via Gcc-patches
With -gstatement-frontiers we may end up with different IR coming from the front end with and without debug information turned on. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100733 for details. That may result in differences in discriminator values and -fcompare-debug failures. This patch

Re: [EXTERNAL] Re: [PATCH] Set discriminators for call stmts on the same line within the same basic block

2022-10-10 Thread Eugene Rozenfeld via Gcc-patches
I sent a patch that fixes a bug introduced by this patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603203.html What you are seeing could have been caused by the same bug since it involves an uninitialized variable. Eugene On Oct 10, 2022, at 5:54 PM, David Edelsohn wrote: 

[PATCH][ICE] Fix for PR107193.

2022-10-10 Thread Eugene Rozenfeld via Gcc-patches
The bug was introduced in f30e9fd33e56a5a721346ea6140722e1b193db42. A variable (cur_locus_e) was incorrectly declared inside a loop. I also moved two other declarations (last and locus) down to make the code more clear. Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: PR debug/107193

Re: [PATCH] Set discriminators for call stmts on the same line within the same basic block

2022-10-06 Thread Eugene Rozenfeld via Gcc-patches
Thank you for the review Jason. I fixed formatting and updated the commit description: Call statements are possible split points of a basic block so they may end up in different basic blocks by the time pass_ipa_auto_profile executes. This change will also simplify

[PATCH] Set discriminators for call stmts on the same line within the same basic block

2022-10-03 Thread Eugene Rozenfeld via Gcc-patches
This change is based on commit 1e6c4a7a8fb8e20545bb9f9032d3854f3f794c18 by Dehao Chen in vendors/google/heads/gcc-4_8. Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * tree-cfg.cc (assign_discriminators): Set discriminators for call stmts on the same line within the same basic

[PATCH] Emit discriminators for inlined call sites.

2022-09-30 Thread Eugene Rozenfeld via Gcc-patches
This change is based on commit 9fa26998a63d4b22b637ed8702520819e408a694 by Dehao Chen in vendors/google/heads/gcc-4_8. gcc/ChangeLog: * dwarf2out.cc (add_call_src_coords_attributes): Emit discriminators for inlined call sites. --- gcc/dwarf2out.cc | 6 +- 1 file changed, 5

[PATCH][PUSHED] Fix AutoFDO tests to not look for hot/cold splitting.

2022-09-27 Thread Eugene Rozenfeld via Gcc-patches
AutoFDO counts are not reliable and we are currently not performing hot/cold splitting based on them. This change adjusts several tree-prof tests not to check for hot/cold splitting when run with AutoFDO. gcc/testsuite/ChangeLog: * gcc.dg/tree-prof/cold_partition_label.c: Don't check for

[PATCH] Fix profile count comparison.

2022-09-23 Thread Eugene Rozenfeld via Gcc-patches
The comparison was incorrect when the counts weren't PRECISE. For example, crossmodule-indir-call-topn-1.c was failing with AutoFDO: when count_sum is 0 with quality AFDO, count_sum > profile_count::zero() evaluates to true. Taking that branch then leads to an assert in the call to to_sreal().

RE: [EXTERNAL] Re: [PING][PATCH] Add instruction level discriminator support.

2022-09-19 Thread Eugene Rozenfeld via Gcc-patches
From: Gcc-patches > On Behalf Of > Eugene Rozenfeld via Gcc-patches > Sent: Thursday, September 01, 2022 1:49 PM > To: Jason Merrill ; gcc-patches@gcc.gnu.org > Cc: Andi Kleen ; Jan Hubicka > Subject: RE: [EXTERNAL] Re: [PING][PATCH] Add instruction level discriminator > suppo

[PATCH][PUSHED] Fix for an AutoFDO test.

2022-09-16 Thread Eugene Rozenfeld via Gcc-patches
After https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c17975d81aaed49ff759c20c68b31304a6953d58 the expected inlining in indir-call-prof-2.c test happens during afdo phase instead of einline. This patch adjusts the test accordingly. gcc/testsuite/ChangeLog: *

RE: [EXTERNAL] Re: [PING][PATCH] Add instruction level discriminator support.

2022-09-08 Thread Eugene Rozenfeld via Gcc-patches
] Add instruction level discriminator support. On 9/1/22 18:22, Eugene Rozenfeld wrote: > Jason, > > I made another small change in addressing your feedback (attached). > > Thanks, > > Eugene > > -Original Message- > From: Gcc-patches > On Behalf Of &

RE: [EXTERNAL] Re: [PING][PATCH] Add instruction level discriminator support.

2022-09-01 Thread Eugene Rozenfeld via Gcc-patches
Jason, I made another small change in addressing your feedback (attached). Thanks, Eugene -Original Message- From: Gcc-patches On Behalf Of Eugene Rozenfeld via Gcc-patches Sent: Thursday, September 01, 2022 1:49 PM To: Jason Merrill ; gcc-patches@gcc.gnu.org Cc: Andi Kleen ; Jan

RE: [EXTERNAL] Re: [PING][PATCH] Add instruction level discriminator support.

2022-09-01 Thread Eugene Rozenfeld via Gcc-patches
85dc68%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637964709325691951 > %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6I > k1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=K%2BMx6jelnED3n%2Be2dT > DYAPOqZZ8Zlsd2%2FyPJ0qib5%2FM%3Dreserved=0 > > Thanks, > > Eugen

RE: [EXTERNAL] [PATCH] contrib: modernize gen_autofdo_event.py

2022-08-26 Thread Eugene Rozenfeld via Gcc-patches
The patch is approved. Eugene -Original Message- From: Andi Kleen Sent: Friday, August 05, 2022 11:29 PM To: Eugene Rozenfeld ; Xi Ruoyao ; gcc-patches@gcc.gnu.org Subject: Re: [EXTERNAL] [PATCH] contrib: modernize gen_autofdo_event.py On 8/6/2022 1:07 AM, Eugene Rozenfeld wrote: >

RE: [EXTERNAL] [PATCH] contrib: modernize gen_autofdo_event.py

2022-08-05 Thread Eugene Rozenfeld via Gcc-patches
The changes look good to me. Also adding Andi, the author of the script. Eugene -Original Message- From: Gcc-patches On Behalf Of Xi Ruoyao via Gcc-patches Sent: Sunday, June 26, 2022 11:15 PM To: gcc-patches@gcc.gnu.org Subject: [EXTERNAL] [PATCH] contrib: modernize

[committed] MAINTAINERS: Add myself as AutoFDO maintainer

2022-08-04 Thread Eugene Rozenfeld via Gcc-patches
ChangeLog: * MAINTAINERS: Add myself as AutoFDO maintainer. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1a37f4419b9..02ced0c43aa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -239,6 +239,7 @@ tree-ssa

RE: [PING][PATCH] Add instruction level discriminator support.

2022-08-03 Thread Eugene Rozenfeld via Gcc-patches
this patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596065.html Thanks, Eugene -Original Message- From: Gcc-patches On Behalf Of Eugene Rozenfeld via Gcc-patches Sent: Thursday, June 02, 2022 12:22 AM To: gcc-patches@gcc.gnu.org; Andi Kleen ; Jan Hubicka Subject: [EXTERNAL

RE: [PING][PATCH] Add instruction level discriminator support.

2022-06-27 Thread Eugene Rozenfeld via Gcc-patches
-Original Message- From: Gcc-patches On Behalf Of Eugene Rozenfeld via Gcc-patches Sent: Thursday, June 02, 2022 12:22 AM To: gcc-patches@gcc.gnu.org; Andi Kleen ; Jan Hubicka Subject: [EXTERNAL] [PATCH] Add instruction level discriminator support. This is the first in a series of patches

RE: [EXTERNAL] Re: [PATCH] Add instruction level discriminator support.

2022-06-12 Thread Eugene Rozenfeld via Gcc-patches
Original Message- From: Andi Kleen Sent: Sunday, June 12, 2022 4:53 PM To: Eugene Rozenfeld via Gcc-patches Cc: Jan Hubicka ; Eugene Rozenfeld Subject: [EXTERNAL] Re: [PATCH] Add instruction level discriminator support. Eugene Rozenfeld via Gcc-patches writes: > { > diff --gi

[PING][PATCH] Add instruction level discriminator support.

2022-06-10 Thread Eugene Rozenfeld via Gcc-patches
Hello, I'd like to ping this patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596065.html Thanks, Eugene -Original Message- From: Gcc-patches On Behalf Of Eugene Rozenfeld via Gcc-patches Sent: Thursday, June 02, 2022 12:22 AM To: gcc-patches@gcc.gnu.org; Andi Kleen ; Jan

[PATCH] Add instruction level discriminator support.

2022-06-02 Thread Eugene Rozenfeld via Gcc-patches
This is the first in a series of patches to enable discriminator support in AutoFDO. This patch switches to tracking discriminators per statement/instruction instead of per basic block. Tracking per basic block was problematic since not all statements in a basic block needed a discriminator and,

RE: [EXTERNAL] Re: [PATCH] Guard against applying scale with 0 denominator

2022-05-20 Thread Eugene Rozenfeld via Gcc-patches
> Subject: [EXTERNAL] Re: [PATCH] Guard against applying scale with 0 > denominator > > On Fri, May 6, 2022 at 10:32 PM Eugene Rozenfeld via Gcc-patches > wrote: > > > > Calling count.apply_scale with a 0 denominator causes an assert. > > This change guards again

RE: [EXTERNAL] Re: [PATCH] Guard against applying scale with 0 denominator

2022-05-11 Thread Eugene Rozenfeld via Gcc-patches
NAL] Re: [PATCH] Guard against applying scale with 0 denominator On Fri, May 6, 2022 at 10:32 PM Eugene Rozenfeld via Gcc-patches wrote: > > Calling count.apply_scale with a 0 denominator causes an assert. > This change guards against that. > > Tested on x86_64-pc-linux-gnu.

[PATCH] Guard against applying scale with 0 denominator

2022-05-06 Thread Eugene Rozenfeld via Gcc-patches
Calling count.apply_scale with a 0 denominator causes an assert. This change guards against that. Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * tree-loop-vect-manip.cc (vect_do_peeling): Guard against applying scale with 0 denominator. --- gcc/tree-vect-loop-manip.cc | 9 + 1

[PATCH] AutoFDO: Don't try to promote indirect calls that result in recursive direct calls

2022-02-08 Thread Eugene Rozenfeld via Gcc-patches
AutoFDO tries to promote and inline all indirect calls that were promoted and inlined in the original binary and that are still hot. In the included test case, the promotion results in a direct call that is a recursive call. inline_call and optimize_inline_calls can't handle recursive calls at

RE: [EXTERNAL] Re: [PATCH] AutoFDO: don't set param_early_inliner_max_iterations to 10.

2022-01-31 Thread Eugene Rozenfeld via Gcc-patches
Cc: gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH] AutoFDO: don't set param_early_inliner_max_iterations to 10. On Sat, Jan 29, 2022 at 12:24 AM Eugene Rozenfeld via Gcc-patches wrote: > > param_early_inliner_max_iterations specifies the maximum number of > nested indirect

[PATCH] AutoFDO: don't set param_early_inliner_max_iterations to 10.

2022-01-28 Thread Eugene Rozenfeld via Gcc-patches
param_early_inliner_max_iterations specifies the maximum number of nested indirect inlining iterations performed by early inliner. Normally, the default value is 1. For AutoFDO this parameter was also used as the number of iteration for its indirect call promotion loop and the default value was

[PATCH] Improve AutoFDO count propagation algorithm

2021-12-02 Thread Eugene Rozenfeld via Gcc-patches
When a basic block A has been annotated with a count and it has only one successor (or predecessor) B, we can propagate the A's count to B. The algorithm without this change could leave B without an annotation if B had other unannotated predecessors (or successors). For example, in the test case I

RE: [EXTERNAL] Re: [PATCH] gcov-profile/71672 Fix indirect call inlining with AutoFDO

2021-08-03 Thread Eugene Rozenfeld via Gcc-patches
] Re: [PATCH] gcov-profile/71672 Fix indirect call inlining with AutoFDO On Fri, Jul 30, 2021 at 9:09 AM Eugene Rozenfeld via Gcc-patches wrote: > > This patch has the following changes: > > 1. The main fix is in auto-profile.c: the histogram value for >indirect calls was inc

[PATCH] gcov-profile/71672 Fix indirect call inlining with AutoFDO

2021-07-30 Thread Eugene Rozenfeld via Gcc-patches
This patch has the following changes: 1. The main fix is in auto-profile.c: the histogram value for indirect calls was incorrectly set up. That is fixed now. 2. Several tests now have -fdump-ipa-afdo-optimized instead of -fdump-ipa-afdo in dg-options so that the expected output can be

[PATCH] Update gen_autofdo_event.py and gcc-auto-profile

2021-07-01 Thread Eugene Rozenfeld via Gcc-patches
gen_autofdo_event.py was stumbling on models with stepping so I updated the script to handle this case similar to the code in https://github.com/andikleen/pmu-tools/blob/c6a5f63aede19def8886d6a8b74d7a55c38ca947/event_download.py The second change was to tolerate cases when the CPU supports PEBS

RE: [PATCH][pushed] gcov: update documentation entry about string format

2021-06-21 Thread Eugene Rozenfeld via Gcc-patches
Thank you for updating the documentation Martin. The following line can now be removed: padding: | char:0 | char:0 char:0 | char:0 char:0 char:0 Eugene -Original Message- From: Gcc-patches On Behalf Of Martin Liška Sent: Thursday, June 17, 2021 2:40 AM To:

RE: [EXTERNAL] [PATCH] gcov: Use system IO buffering

2021-06-17 Thread Eugene Rozenfeld via Gcc-patches
Thank you for your reply Martin! AUTO_PROFILE_VERSION should also be changed. Then create_gcov can be updated to support both the old format and the new format. Eugene -Original Message- From: Martin Liška Sent: Thursday, June 17, 2021 2:38 AM To: Eugene Rozenfeld ;

RE: [EXTERNAL] [PATCH] gcov: Use system IO buffering

2021-06-16 Thread Eugene Rozenfeld via Gcc-patches
The commit from this patch (https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=23eb66d1d46a34cb28c4acbdf8a1deb80a7c5a05) changed the semantics of gcov_read_string and gcov_write_string. Before this change the string storage was as described in gcov-io.h: "Strings are padded with 1 to 4 NUL

[PATCH 1/1] Fix a typo in an AutoFDO error string

2021-06-11 Thread Eugene Rozenfeld via Gcc-patches
Trivial change, committed to trunk. [PATCH 1/1] Fix a typo in an AutoFDO error string gcc/ChangeLog: * auto-profile.c (read_profile): fix a typo in an error string --- gcc/auto-profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/auto-profile.c

[COMMITTED] MAINTAINERS: Add myself for write after approval

2021-03-12 Thread Eugene Rozenfeld via Gcc-patches
ChangeLog: 2021-03-12 Eugene Rozenfeld * MAINTAINERS (Write After Approval): Add myself. 0001-MAINTAINERS-Add-myself-for-write-after-approval.patch Description: 0001-MAINTAINERS-Add-myself-for-write-after-approval.patch

RE: [EXTERNAL] Re: [PATCH][tree-optimization]Optimize combination of comparisons to dec+compare

2021-01-19 Thread Eugene Rozenfeld via Gcc-patches
gt; > That is an invalid transformation: e.g., consider x=3, y=4, CST=2. > > Can you please clarify? > > > > Thanks, > > > > Eugene > > > > -Original Message- > > From: Richard Biener > > Sent: Thursday, December 10, 2020 12:21 A

RE: [EXTERNAL] Re: [PATCH][tree-optimization]Optimize combination of comparisons to dec+compare

2021-01-14 Thread Eugene Rozenfeld via Gcc-patches
he patch. > > Richard, can you please clarify your feedback? Hmm, OK. The patch is OK. Thanks, Richard. > Thanks, > > Eugene > > -Original Message- > From: Gcc-patches On Behalf Of > Eugene Rozenfeld via Gcc-patches > Sent: Tuesday, December 15, 2020 2:06

[PATCH][tree-optimization]Optimize combination of comparisons to dec+compare

2021-01-04 Thread Eugene Rozenfeld via Gcc-patches
feedback? Thanks, Eugene -Original Message- From: Gcc-patches On Behalf Of Eugene Rozenfeld via Gcc-patches Sent: Tuesday, December 15, 2020 2:06 PM To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: Optimize combination of comparisons to dec+compare Richard, >

RE: Optimize combination of comparisons to dec+compare

2020-12-22 Thread Eugene Rozenfeld via Gcc-patches
Re-sending my question and re-attaching the patch. Richard, can you please clarify your feedback? Thanks, Eugene -Original Message- From: Gcc-patches On Behalf Of Eugene Rozenfeld via Gcc-patches Sent: Tuesday, December 15, 2020 2:06 PM To: Richard Biener Cc: gcc-patches@gcc.gnu.org

Re: Optimize combination of comparisons to dec+compare

2020-12-15 Thread Eugene Rozenfeld via Gcc-patches
ozenfeld Cc: gcc-patches@gcc.gnu.org Subject: Re: Optimize combination of comparisons to dec+compare On Thu, Dec 10, 2020 at 1:52 AM Eugene Rozenfeld via Gcc-patches wrote: > > This patch adds a pattern for optimizing x < y || x == XXX_MIN to x <= > y-1 if y is an integer with

Optimize combination of comparisons to dec+compare

2020-12-09 Thread Eugene Rozenfeld via Gcc-patches
This patch adds a pattern for optimizing x < y || x == XXX_MIN to x <= y-1 if y is an integer with TYPE_OVERFLOW_WRAPS. This fixes pr96674. Tested on x86_64-pc-linux-gnu. For this function bool f(unsigned a, unsigned b) { return (b == 0) | (a < b); } the code without the patch is test

Re: [PATCH] [tree-optimization] Optimize max/min pattern with comparison

2020-11-30 Thread Eugene Rozenfeld via Gcc-patches
bject: Re: [PATCH] [tree-optimization] Optimize max/min pattern with comparison On 11/25/20 3:04 PM, Eugene Rozenfeld via Gcc-patches wrote: > Make the following simplifications: > X <= MAX(X, Y) -> true > X > MAX(X, Y) -> false > X >= MIN(X, Y) -> true &g

[PATCH] [tree-optimization] Optimize max/min pattern with comparison

2020-11-25 Thread Eugene Rozenfeld via Gcc-patches
Make the following simplifications: X <= MAX(X, Y) -> true X > MAX(X, Y) -> false X >= MIN(X, Y) -> true X < MIN(X, Y) -> false This fixes PR96708. Tested on x86_64-pc-linux-gnu. bool f(int a, int b) { int tmp = (a < b) ? b : a; return tmp >= a; } Code without

[PATCH] [tree-optimization] Optimize or+and+or pattern to and+or

2020-11-22 Thread Eugene Rozenfeld via Gcc-patches
Simplify ((b | c) & a) | b to (a & c) | b. This fixes PR96679. Tested on x86_64-pc-linux-gnu. int f(int a, int b, int c) { return ((b | c) & a) | b; } Code without the patch: or edx,esi andedx,edi moveax,edx or eax,esi ret Code with the patch: andedi,edx mov

RE: [EXTERNAL] Re: [PATCH] [tree-optimization] Optimize two patterns with three xors.

2020-11-19 Thread Eugene Rozenfeld via Gcc-patches
Thank you for installing my patch Jeff! Yes, I intend to contribute regularly. I'm working on getting copyright assignment/disclaimer paperwork approved by my employer. I'll apply for commit privs after that. Eugene -Original Message- From: Jeff Law Sent: Wednesday, November 18,

Re: [PATCH] [tree-optimization] Optimize two patterns with three xors.

2020-11-16 Thread Eugene Rozenfeld via Gcc-patches
-patches@gcc.gnu.org Subject: Re: [PATCH] [tree-optimization] Optimize two patterns with three xors. On Thu, Nov 12, 2020 at 2:53 AM Eugene Rozenfeld via Gcc-patches wrote: > > Simplify (a ^ b) & ((b ^ c) ^ a) --> (a ^ b) & ~c. > > int f(int a, int b, int c) > { >

[PATCH] [tree-optimization] Optimize two patterns with three xors.

2020-11-11 Thread Eugene Rozenfeld via Gcc-patches
Simplify (a ^ b) & ((b ^ c) ^ a) --> (a ^ b) & ~c. int f(int a, int b, int c) { return (a ^ b) & ((b ^ c) ^ a); } Code without the patch: moveax,edx xoreax,esi xoreax,edi xoredi,esi andeax,edi ret Code with the patch: xoredi,esi andn eax,edx,edi ret Simplify

[PATCH] [tree-optimization] Fix for PR96701

2020-10-29 Thread Eugene Rozenfeld via Gcc-patches
This patch adds a pattern for folding x >> x to   0 as described in PR96701. Without this patch the x86_64-pc-linux-gnu code generated for this function int foo (int i) {   return i >> i; } is mov    ecx,edi sar    edi,cl test   edi,edi setne  al ret With the

[PATCH] [tree-optimization] Fix for PR96701

2020-10-29 Thread Eugene Rozenfeld via Gcc-patches
This patch adds a pattern for folding x >> x to 0 as described in PR96701. Without this patch the x86_64-pc-linux-gnu code generated for this function int foo (int i) { return i >> i; } is movecx,edi saredi,cl test edi,edi setne al

RE: [EXTERNAL] Re: [PATCH] [tree-optimization] Fix for PR97223

2020-10-29 Thread Eugene Rozenfeld via Gcc-patches
hes@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH] [tree-optimization] Fix for PR97223 On Sat, Oct 24, 2020 at 2:20 AM Eugene Rozenfeld via Gcc-patches wrote: > > This patch adds a pattern for folding > x < (short) ((unsigned short)x + const) to > x &l

[PATCH] [tree-optimization] Fix for PR97223

2020-10-23 Thread Eugene Rozenfeld via Gcc-patches
This patch adds a pattern for folding x < (short) ((unsigned short)x + const) to x <= SHORT_MAX - const (and similarly for other integral types) if const is not 0. as described in PR97223. For example, without this patch the x86_64-pc-linux code generated for this