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 <dmalc...@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 <tho...@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