[PATCH] Don't set full_profile in auto-profile [PR113765]

2024-03-27 Thread Eugene Rozenfeld
auto-profile currently doesn't guarantee that it will set probabilities on all edges because of zero basic block counts. Normally those edges just have probabilities set by the preceding profile_estimate pass but under -O0 profile_estimate pass doesn't run. The patch removes setting of full_profile

RE: [EXTERNAL] [PATCH] skip debug stmts when assigning locus discriminators

2023-11-08 Thread Eugene Rozenfeld
@gcc.gnu.org Cc: Eugene Rozenfeld Subject: [EXTERNAL] [PATCH] skip debug stmts when assigning locus discriminators c-c++-common/goacc/kernels-loop-g.c has been failing (compare-debug) on i686-linux-gnu since r13-3172, because the implementation enabled debug stmts to cause discriminators to be

[PATCH] Fixes for profile count/probability maintenance

2023-09-19 Thread Eugene Rozenfeld
Verifier checks have recently been strengthened to check that all counts and probabilities are initialized. The checks fired during autoprofiledbootstrap build and this patch fixes it. gcc/ChangeLog: * auto-profile.cc (afdo_calculate_branch_prob): Fix count comparisons * ipa-utils

[PATCH] Remove .PHONY targets when building .fda files during autoprofiledbootstrap

2023-09-19 Thread Eugene Rozenfeld
These .PHONY targets are always executed and were breaking `make install` for autoprofiledbootstrap build. gcc/ChangeLog: * c/Make-lang.in: Make create_fdas_for_cc1 target not .PHONY * cp/Make-lang.in: Make create_fdas_for_cc1plus target not .PHONY * lto/Make-lang.in: Make

RE: [EXTERNAL] [PATCH] Enable autofdo bootstrap for lto/fortran

2024-11-08 Thread Eugene Rozenfeld
@gcc.gnu.org Cc: Eugene Rozenfeld ; Andi Kleen Subject: [EXTERNAL] [PATCH] Enable autofdo bootstrap for lto/fortran From: Andi Kleen When autofdo bootstrap support was originally implemented there were issues with the LTO bootstrap, that is why it wasn't enabled for them. I retested this no

RE: [EXTERNAL] Re: [PATCH] PR117350: Keep assembler name for abstract decls for autofdo

2024-11-08 Thread Eugene Rozenfeld
The patch looks good to me. -Original Message- From: Richard Biener Sent: Wednesday, November 6, 2024 12:01 AM To: Andi Kleen Cc: Jason Merrill ; Andi Kleen ; gcc-patches@gcc.gnu.org; Eugene Rozenfeld ; pins...@gmail.com; Andi Kleen Subject: [EXTERNAL] Re: [PATCH] PR117350: Keep

RE: [EXTERNAL] [PATCH] Update gcc-auto-profile / gen_autofdo_event.py

2024-11-08 Thread Eugene Rozenfeld
The patch looks good to me. Thank you for fixing this, Andi. -Original Message- From: Andi Kleen Sent: Thursday, October 31, 2024 4:37 PM To: gcc-patches@gcc.gnu.org Cc: Eugene Rozenfeld ; Andi Kleen Subject: [EXTERNAL] [PATCH] Update gcc-auto-profile / gen_autofdo_event.py From

[PATCH] Fix setting of call graph node AutoFDO count [PR116743]

2025-01-13 Thread Eugene Rozenfeld
We are initializing both the call graph node count and the entry block count of the function with the head_count value from the profile. Count propagation algorithm may refine the entry block count and we may end up with a case where the call graph node count is set to 0 but the entry block count

RE: [EXTERNAL] Re: [PATCH] Fix setting of call graph node AutoFDO count [PR116743]

2025-01-15 Thread Eugene Rozenfeld
I committed the patch to trunk. Is it ok to backport to gcc-12, gcc-13, and gcc-14? -Original Message- From: Richard Biener Sent: Monday, January 13, 2025 11:22 PM To: Eugene Rozenfeld Cc: GCC-Patches-ML ; Jan Hubicka ; rvmal...@amazon.com Subject: [EXTERNAL] Re: [PATCH] Fix setting

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 gen_autofdo_e

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

2022-08-03 Thread Eugene Rozenfeld via Gcc-patches
One more ping for this patch https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596065.html CC Jason since this changes discriminators emitted in dwarf. Thanks, Eugene -Original Message- From: Eugene Rozenfeld Sent: Monday, June 27, 2022 12:45 PM To: gcc-patches@gcc.gnu.org; Andi

[committed] MAINTAINERS: Add myself as AutoFDO maintainer

2022-08-04 Thread Eugene Rozenfeld via Gcc-patches
Andrew MacLeod tree browser/unparser Sebastian Pop scev, data dependence Sebastian Pop profile feedback Jan Hubicka +AutoFDOEugene Rozenfeld reload Ulrich Weigand RTL optimizers

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 gen_autofdo_event.p

[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, stage1-gcc/cc1

[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 event

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

2023-06-30 Thread Eugene Rozenfeld via Gcc-patches
ething low enough. 80% instead of the current threshold of 95% should work, although it's a bit fragile. Eugene -Original Message- From: Sam James Sent: Friday, June 30, 2023 1:59 AM To: Richard Biener Cc: Eugene Rozenfeld ; gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH] Co

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-07-05 Thread Eugene Rozenfeld via Gcc-patches
data ] [ perf record: Captured and wrote 0.037 MB /home/erozen/gcc1_objdir/gcc/testsuite/gcc/indir-call-prof.perf.data (86 samples) ] Eugene -Original Message- From: Richard Biener Sent: Monday, July 3, 2023 12:47 AM To: Eugene Rozenfeld Cc: Sam James ; gcc-patches@gcc.gnu.org Subjec

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

2023-03-14 Thread Eugene Rozenfeld via Gcc-patches
: Eugene Rozenfeld ; gcc-patches@gcc.gnu.org; Andi Kleen Subject: Re: [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/22/22 14:20, Eugene Roze

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

2023-05-09 Thread Eugene Rozenfeld via Gcc-patches
_fn_summary (cgraph_node::get (current_function_decl), true); pop_cfun (); } return 0; Thanks, Eugene -Original Message- From: Richard Biener Sent: Monday, May 8, 2023 11:40 PM To: Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH][PUSHED] Fix cfg mainte

[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] 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/ -B/home/er

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

2023-05-10 Thread Eugene Rozenfeld via Gcc-patches
y, May 9, 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 n

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

2023-05-12 Thread Eugene Rozenfeld via Gcc-patches
Message- From: Richard Biener Sent: Thursday, May 11, 2023 1:58 AM To: Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org Subject: Re: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build On Thu, May 11, 2023 at 4:23 AM Eugene Rozenfeld wrote: > >

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

2023-05-17 Thread Eugene Rozenfeld via Gcc-patches
- From: Thomas Schwinge Sent: Wednesday, May 17, 2023 12:05 AM To: Richard Biener ; Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org Subject: Re: [EXTERNAL] Re: [PATCH] Fixes and workarounds for warnings during autoprofiledbootstrap build Hi! On 2023-05-15T09:30:35+0200, Richard Biener via

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

2021-08-03 Thread Eugene Rozenfeld via Gcc-patches
Thank you for the reviews, Andy and Richard. I split up the patch into 4 commits and pushed to trunk. Eugene -Original Message- From: Richard Biener Sent: Monday, August 2, 2021 2:57 AM To: Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org; mli...@suse.cz; Andi Kleen Subject: [EXTERNAL

[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: * gcc.dg/tree-prof/indir-call-pr

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

2022-09-19 Thread Eugene Rozenfeld via Gcc-patches
Hi Jason, Do you have any more feedback for this patch? Thanks, Eugene -Original Message- From: Eugene Rozenfeld Sent: Thursday, September 08, 2022 5:46 PM To: Jason Merrill ; gcc-patches@gcc.gnu.org Cc: Andi Kleen ; Jan Hubicka Subject: RE: [EXTERNAL] Re: [PING][PATCH] Add

[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(). Tes

[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] Emit discriminators for inlined call sites.

2022-09-29 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 insertion

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

2022-10-02 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 bloc

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
21 PM To: Eugene Rozenfeld ; gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH] Set discriminators for call stmts on the same line within the same basic block On 10/3/22 02:08, Eugene Rozenfeld wrote: > This change is based on commit > 1e6c4a7a8fb8e20545bb9f9032d3854f3f794c18 > by Deha

[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: [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:  Th

[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 se

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

2022-01-31 Thread Eugene Rozenfeld via Gcc-patches
Thank you for the review Richard. Is it ok to commit this change to trunk now or should I wait till GCC 13 development starts? This seems like a very low risk change. Thanks, Eugene -Original Message- From: Richard Biener Sent: Monday, January 31, 2022 1:23 AM To: Eugene Rozenfeld

[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 this

[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

[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 di

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

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

2022-10-17 Thread Eugene Rozenfeld via Gcc-patches
tting more. So I'd like to disable printing discriminators in -fcompare-debug dums until -gstatement-frontier issue is fixed. Eugene -Original Message- From: Richard Biener Sent: Monday, October 17, 2022 12:06 AM To: Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org; Jason Merril

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
round is passing -gno-statement-frontiers to the test. Eugene -Original Message- From: Thomas Schwinge Sent: Monday, October 17, 2022 3:46 AM To: Eugene Rozenfeld Cc: haochen.ji...@intel.com; gcc-patches@gcc.gnu.org; gcc-regress...@gcc.gnu.org Subject: [EXTERNAL] RE: [r13-3172 Regre

[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 insertions(+

[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 +

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] Re: [PING][PATCH] Add instruction level discriminator support.

2022-09-01 Thread Eugene Rozenfeld via Gcc-patches
Jason, Thank you for your review. You are correct, we only need to check has_discriminator for the statement that's on the same line. I updated the patch (attached). Thanks, Eugene -Original Message- From: Jason Merrill Sent: Thursday, August 18, 2022 6:55 PM To: Eugene Roze

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-08 Thread Eugene Rozenfeld via Gcc-patches
Jason, Thank for your suggestion. The patch is updated (attached). Thanks, Eugene -Original Message- From: Jason Merrill Sent: Thursday, September 08, 2022 10:26 AM To: Eugene Rozenfeld ; gcc-patches@gcc.gnu.org Cc: Andi Kleen ; Jan Hubicka Subject: Re: [EXTERNAL] Re: [PING][PATCH

[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

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

2022-05-11 Thread Eugene Rozenfeld via Gcc-patches
locks in the epilog. I'd like to get my simple fix in since it makes things better even if it doesn't address the issue mentioned In the FIXME. -Original Message- From: Richard Biener Sent: Monday, May 09, 2022 12:42 AM To: Eugene Rozenfeld ; Jan Hubicka Cc: gcc-patch

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

2022-05-20 Thread Eugene Rozenfeld via Gcc-patches
Thank you for the feedback Richard. I attached a patch that saves/restores counts if the epilog doesn't use a scalar loop. Eugene -Original Message- From: Richard Biener Sent: Thursday, May 12, 2022 12:34 AM To: Eugene Rozenfeld Cc: Jan Hubicka ; gcc-patches@gcc.gnu.org Subjec

[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 (a

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

2020-11-16 Thread Eugene Rozenfeld via Gcc-patches
on is beneficial even if the second or third bit_xor has more than one use since we are simplifying them to just a single operand (@2). If that is incorrect, please explain why. Eugene -Original Message- From: Richard Biener Sent: Monday, November 16, 2020 4:11 AM To: Eugene Rozenfeld Cc

[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 b/gcc/auto-pr

[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 found

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. Eu

Re: Optimize combination of comparisons to dec+compare

2020-12-15 Thread Eugene Rozenfeld via Gcc-patches
Richard, > Do we already handle x < y || x <= CST to x <= y - CST? 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 AM To: Eugene R

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

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

2021-01-04 Thread Eugene Rozenfeld via Gcc-patches
Ping. -Original Message- From: Eugene Rozenfeld Sent: Tuesday, December 22, 2020 3:01 PM To: Richard Biener ; gcc-patches@gcc.gnu.org Subject: RE: Optimize combination of comparisons to dec+compare Re-sending my question and re-attaching the patch. Richard, can you please clarify your

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

2021-01-14 Thread Eugene Rozenfeld via Gcc-patches
-Original Message- From: Richard Biener Sent: Tuesday, January 5, 2021 4:21 AM To: Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH][tree-optimization]Optimize combination of comparisons to dec+compare On Mon, Jan 4, 2021 at 9:50 PM Eugene Rozenfeld wrote: > >

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

2021-01-19 Thread Eugene Rozenfeld via Gcc-patches
Richard, Can you please commit this patch for me? I don't have write access yet, I'm still working on getting copyright assignment/disclaimer signed by my employer. Thanks, Eugene -Original Message- From: Richard Biener Sent: Friday, January 15, 2021 3:55 AM To: Eugene Roz

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

2020-11-19 Thread Eugene Rozenfeld via Gcc-patches
ovember 18, 2020 11:33 AM To: Richard Biener ; Eugene Rozenfeld Cc: gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH] [tree-optimization] Optimize two patterns with three xors. On 11/17/20 12:57 AM, Richard Biener via Gcc-patches wrote: > On Tue, Nov 17, 2020 at 3:19 AM Eugene Rozenf

[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 moveax,edi

[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 th

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

2020-11-30 Thread Eugene Rozenfeld via Gcc-patches
GE_EXPR and LE_EXPR and false otherwise. I added two test files: one for positive cases and one for negative cases. The updated patch is attached. Thanks, Eugene -Original Message- From: Jeff Law Sent: Monday, November 30, 2020 9:51 AM To: Eugene Rozenfeld ; gcc-patches@gcc.gnu.o

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

[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 functi

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

2020-10-29 Thread Eugene Rozenfeld via Gcc-patches
_1; int _3; [local count: 1073741824]: _1 = i_2(D) != 2147483647; _3 = (int) _1; return _3; } This is a correct optimization since -fno-strict-overflow implies -fwrapv. Eugene -Original Message- From: Richard Biener Sent: Tuesday, October 27, 2020 2:23 AM To: Eugene Rozenfeld Cc

[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 r

[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

[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 x86_64-pc-linux-gnu.

[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, a

[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

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

2022-06-12 Thread Eugene Rozenfeld via Gcc-patches
reak; -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: > { > dif

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

2022-06-27 Thread Eugene Rozenfeld via Gcc-patches
: Eugene Rozenfeld Sent: Friday, June 10, 2022 12:03 PM To: gcc-patches@gcc.gnu.org; Andi Kleen ; Jan Hubicka Subject: [PING][PATCH] Add instruction level discriminator support. Hello, I'd like to ping this patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596065.html Thanks, E

[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] [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 bytes,

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 ; gcc-patches

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: gcc-patches@gcc.gnu.

[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 bu

[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 f

[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 * cp/M

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 vi

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

2022-12-06 Thread Eugene Rozenfeld via Gcc-patches
r (int i = 0, j = 0; i < iterations; ++i, j = (j + 1) % 10) +array[j] = foo (); +} -- 2.25.1 -Original Message- From: Jeff Law Sent: Tuesday, November 22, 2022 12:03 PM To: Eugene Rozenfeld ; gcc-patches@gcc.gnu.org Subject: [EXTERNAL] Re: [PATCH] Fix count comparison in ipa-cp [You d

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