From: "Martin Liška" <mliska@suse.cz>
To: Jeff Law <law@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Port value profiling to -fopt-info infrastructure.
Date: Fri, 09 Aug 2019 08:11:00 -0000 [thread overview]
Message-ID: <6ccee2d3-aa31-3ebb-cfc5-804403ee088c@suse.cz> (raw)
In-Reply-To: <5a1e050b-1c36-3b3f-15d5-7a2bec71e111@redhat.com>
On 8/8/19 4:17 PM, Jeff Law wrote:
> On 8/8/19 7:04 AM, Martin Liška wrote:
>> Hi.
>>
>> As requested by Richi, I'm suggesting to use new dump_printf
>> optimization info infrastructure.
>>
>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>>
>> Ready to be installed?
>> Thanks,
>> Martin
>>
>> gcc/ChangeLog:
>>
>> 2019-08-08 Martin Liska <mliska@suse.cz>
>>
>> * value-prof.c (gimple_divmod_fixed_value_transform):
>> Use dump_printf_loc.
>> (gimple_mod_pow2_value_transform): Likewise.
>> (gimple_mod_subtract_transform): Likewise.
>> (init_node_map): Likewise.
>> (gimple_ic_transform): Likewise.
>> (gimple_stringops_transform): Likewise.
>>
>> gcc/testsuite/ChangeLog:
>>
>> 2019-08-08 Martin Liska <mliska@suse.cz>
>>
>> * g++.dg/tree-prof/indir-call-prof.C: Add -optimize
>> to -fdump-ipa-profile.
>> * g++.dg/tree-prof/morefunc.C: Likewise.
>> * g++.dg/tree-prof/reorder.C: Likewise.
>> * gcc.dg/tree-prof/ic-misattribution-1.c: Likewise.
>> * gcc.dg/tree-prof/indir-call-prof.c: Likewise.
>> * gcc.dg/tree-prof/stringop-1.c: Likewise.
>> * gcc.dg/tree-prof/stringop-2.c: Likewise.
>> * gcc.dg/tree-prof/val-prof-1.c: Likewise.
>> * gcc.dg/tree-prof/val-prof-2.c: Likewise.
>> * gcc.dg/tree-prof/val-prof-3.c: Likewise.
>> * gcc.dg/tree-prof/val-prof-4.c: Likewise.
>> * gcc.dg/tree-prof/val-prof-5.c: Likewise.
>> * gcc.dg/tree-prof/val-prof-7.c: Likewise.
>> ---
>> .../g++.dg/tree-prof/indir-call-prof.C | 2 +-
>> diff --git a/gcc/value-prof.c b/gcc/value-prof.c
>> index 759458868a8..9d9785b179d 100644
>> --- a/gcc/value-prof.c
>> +++ b/gcc/value-prof.c
>> @@ -809,12 +809,9 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator *si)
>> @@ -1445,41 +1447,36 @@ gimple_ic_transform (gimple_stmt_iterator *gsi)
> [ ... ]
>> - if (dump_file)
>> + if (dump_enabled_p ())
>> {
>> - fprintf (dump_file, "Indirect call -> direct call ");
>> - print_generic_expr (dump_file, gimple_call_fn (stmt), TDF_SLIM);
>> - fprintf (dump_file, "=> ");
>> - print_generic_expr (dump_file, direct_call->decl, TDF_SLIM);
>> - fprintf (dump_file, " transformation on insn postponned to ipa-profile");
>> - print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
>> - fprintf (dump_file, "hist->count %" PRId64
>> - " hist->all %" PRId64"\n", count, all);
>> + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, stmt,
>> + "Indirect call -> direct call "
>> + "%T => %T transformation on insn postponed "
>> + "to ipa-profile: %G", gimple_call_fn (stmt),
>> + direct_call->decl, stmt);
>> + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, stmt,
>> + "hist->count %" PRId64
>> + " hist->all %" PRId64"\n", count, all);
>> }
> It's not entirely clear if you want MSG_OPTIMIZED_LOCATION vs
> MSG_MISSED_OPTIMIZATION here. Double check and adjust if needed.
Yes, I want MSG_OPTIMIZED_LOCATIONS as we optimize here but postpone
the transformation.
Thanks for review,
Martin
>
> OK with or without that adjustment.
>
> Jeff
>
next prev parent reply other threads:[~2019-08-09 7:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 13:42 Martin Liška
2019-08-08 14:21 ` Jeff Law
2019-08-09 8:11 ` Martin Liška [this message]
2019-08-09 8:20 ` Richard Biener
2019-08-09 13:57 ` Martin Liška
2019-08-12 15:17 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ccee2d3-aa31-3ebb-cfc5-804403ee088c@suse.cz \
--to=mliska@suse.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=law@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).