public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Thomas Schwinge <thomas@codesourcery.com>,
	David Malcolm <dmalcolm@redhat.com>,
	gcc-patches@gcc.gnu.org,
	Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
	Mike Stump <mikestump@comcast.net>
Subject: Re: Add 'dg-note' next to 'dg-optimized', 'dg-missed' (was: [PATCH] dumpfile.c: use prefixes other that 'note: ' for MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION})
Date: Mon, 30 Nov 2020 12:28:31 -0700	[thread overview]
Message-ID: <7312ba31-de62-fb1b-4198-20bc3a214f24@redhat.com> (raw)
In-Reply-To: <87wnyb84i1.fsf@dem-tschwing-1.ger.mentorg.com>



On 11/24/20 2:53 AM, Thomas Schwinge wrote:
> Hi!
>
> Ping.
>
>
> Grüße
>  Thomas
>
>
> On 2020-11-06T10:26:46+0100, I wrote:
>> Hi, again!
>>
>> On 2018-09-25T16:00:14-0400, David Malcolm <dmalcolm@redhat.com> wrote:
>>> As noted at Cauldron, dumpfile.c currently emits "note: " for all kinds
>>> of dump message, so that (after filtering) there's no distinction between
>>> MSG_OPTIMIZED_LOCATIONS vs MSG_NOTE vs MSG_MISSED_OPTIMIZATION in the
>>> textual output.
>>>
>>> This patch changes dumpfile.c so that the "note: " varies to show
>>> which MSG_* was used, with the string prefix matching that used for
>>> filtering in -fopt-info, hence e.g.
>>>   directive_unroll_3.f90:24:0: optimized: loop unrolled 7 times
>>> and:
>>>   pr19210-1.c:24:3: missed: missed loop optimization: niters analysis ends up with assumptions.
>> (However, 'MSG_NOTE'/'note: ' also still remains used for "general
>> optimization info".)
>>
>>> The patch adds "dg-optimized" and "dg-missed" directives
>>> --- a/gcc/testsuite/lib/gcc-dg.exp
>>> +++ b/gcc/testsuite/lib/gcc-dg.exp
>>> +# Handle output from -fopt-info for MSG_OPTIMIZED_LOCATIONS:
>>> +# a successful optimization.
>>> +
>>> +proc dg-optimized { args } {
>>> +    # Make this variable available here and to the saved proc.
>>> +    upvar dg-messages dg-messages
>>> +
>>> +    process-message saved-dg-error "optimized: " "$args"
>>> +}
>>> +
>>> +# Handle output from -fopt-info for MSG_MISSED_OPTIMIZATION:
>>> +# a missed optimization.
>>> +
>>> +proc dg-missed { args } {
>>> +    # Make this variable available here and to the saved proc.
>>> +    upvar dg-messages dg-messages
>>> +
>>> +    process-message saved-dg-error "missed: " "$args"
>>> +}
>>> +
>> Next to these, I'm proposing to add 'dg-note', see attached "[WIP] Add
>> 'dg-note' next to 'dg-optimized'", which may be used instead of generic
>> 'dg-message' (which in current uses in testcases often doesn't scan for
>> the 'note: ' prefix, by the way).
>>
>> The proposed 'dg-note' has the additional property that "if dg-note is
>> used once, [notes] must *all* be handled explicitly".  The rationale is
>> that either you're not interested in notes at all (default behavior of
>> pruning all notes), but often, when you're interested in one note, you're
>> in fact interested in all notes, and especially interested if
>> *additional* notes appear over time, as GCC evolves.  It seemed somewhat
>> useful, but I'm not insisting on coupling the disabling of notes pruning
>> on 'dg-note' usage, so if anyone feels strongly about that, please speak
>> up.
>>
>> TODO document (also 'dg-optimized', 'dg-missed')
>>
>> TODO 'gcc/testsuite/lib/lto.exp' change necessary/desirable?
>>
>> The latter got added in commit 824721f0905478ebc39e6a295cc8e95c22fa9d17
>> "lto, testsuite: Fix ICE in -Wodr (PR lto/83121)".  David, do you happen
>> to have an opinion on that one?
>>
>>
>> Grüße
>>  Thomas
>>
>>
>> From bb293fff7580025a3b78fc1619d8bf0d8f8b8a1a Mon Sep 17 00:00:00 2001
>> From: Thomas Schwinge <thomas@codesourcery.com>
>> Date: Fri, 6 Nov 2020 09:01:26 +0100
>> Subject: [PATCH] [WIP] Add 'dg-note' next to 'dg-optimized', 'dg-missed'
>>
>> TODO document (also 'dg-optimized', 'dg-missed')
>>
>> TODO 'gcc/testsuite/lib/lto.exp' change necessary/desirable?
I think this is generally fine with the proper doc updates.  I wouldn't
think we'd want/need to treat LTO differently, so I'm not so sure about
that specific hunk.


Jeff


  reply	other threads:[~2020-11-30 19:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 21:55 [PATCH] dumpfile.c: use prefixes other that 'note: ' for MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION} David Malcolm
2018-09-28  9:44 ` Richard Biener
2018-09-29 23:06 ` Andreas Schwab
2018-10-01 14:20   ` David Malcolm
2018-10-01 14:29     ` Andreas Schwab
2018-10-04 11:34       ` Rainer Orth
2018-12-05 13:57         ` Rainer Orth
2020-11-06  8:38 ` Thomas Schwinge
2020-11-13 22:06   ` Jeff Law
2020-11-24  9:46     ` Thomas Schwinge
2020-11-06  8:50 ` Thomas Schwinge
2020-11-13 22:06   ` Jeff Law
2020-11-24  9:51     ` Thomas Schwinge
2020-11-06  9:26 ` Add 'dg-note' next to 'dg-optimized', 'dg-missed' (was: [PATCH] dumpfile.c: use prefixes other that 'note: ' for MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION}) Thomas Schwinge
2020-11-24  9:53   ` Thomas Schwinge
2020-11-30 19:28     ` Jeff Law [this message]
2021-05-18 10:46       ` Add 'dg-note', 'dg-lto-note' (was: Add 'dg-note' next to 'dg-optimized', 'dg-missed') Thomas Schwinge

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=7312ba31-de62-fb1b-4198-20bc3a214f24@redhat.com \
    --to=law@redhat.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    --cc=thomas@codesourcery.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).