This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add option for dumping to stderr (issue6190057)


I am enclosing an updated patch. Please see comments inline.

On Wed, Sep 19, 2012 at 5:01 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Tue, Sep 18, 2012 at 10:48 AM, Sharad Singhai <singhai@google.com> wrote:
>> In response to the recent comments, I have updated the patch to do the
>> following:
>>
>> - Remove pass handling from -fopt-info
>> - Support additional flags in regular dumps
>>
>> I have massaged the options so that they have the following (hopefully
>> clearer) behavior:
>>
>> gcc ... -fopt-info ....   ---> dump all optimization info on stderr
>> gcc ... -fopt-info-missed-optimized=file.txt  --> dump info about
>> optimization applied as well as missed opportunities on to file.txt.
>> If no file.txt is provided, then use stderr.
>>
>> I have enhanced regular dump flags, so that values accepted by
>> -fopt-info are also accepted. For example,
>> gcc ... -O2 -ftree-vectorize -fdump-tree-vect-optimized=foo.dump
>>
>> Now foo.dump will include the regular tree-vect dump as well as the
>> output of -fopt-info=optimized. This way developers can get more
>> detailed dumps when needed.
>
> In addition?  The dumping infrastructure has only one dump statement
> for each bit so you make it emit things twice in some circumstances then?
> That doesn't sound too useful.

Perhaps I misled earlier, there is no duplicate information present on
the dump output. There are two separate streams with two disjoint set
of flags. All of the old behavior is preserved except in case of
"-details" flag -- its meaning is augmented to print *all* available
information. Thus a regular dump plus opt-info dump (if any) is output
in response to "-details". Even in this case the output is not
duplicated. So for example,

   gcc ... -ftree-vectorize -fdump-tree-vect-details

would have regular dump plus information about vectorization since the
user asked for details. Earlier this information was missing from the
regular dumps and was only available via -ftree-vectorizer-verbose=N.

As another example, in case of

   gcc ... -fdump-tree-vect-details=foo.details -fopt-info-optimized

The regular tree-vect dump + opt-info dumps are sent to foo.details,
while information about optimized locations only is output onto
stderr. Note that there is some duplication of information here in the
sense that foo.details is a superset of what is dumped to stderr. But
that is what user asked for and this duplication is across two
separate streams.

>> I have also changed the meaning of dump option "details" to include
>> optimization details. Thus "-details" flag implies
>> "-missed-optimized-note" in addition to other dumps.
>
> I think regular dumps should not accept the -fopt-info flags.

Okay, agreed. It is confusing. I have updated the patch so the
-fopt-info flags are no longer accepted by the regular dumps.

>> The pass level filtering of -fopt-info dumps can be done in a follow
>> up patch. It may even turn out to be unnecessary, because the
>> equivalent effect can be achieved by
>> -ftree-PASS-optimized-missed-note.
>
> It can be done as followup, but I think that is what is really useful.
> Directing users to -fdump-tree... should never be the answer here.

Agreed. I still need to come up with some kind of mapping between
higher-level optimizations and corresponding group of passes. That
needs some discussion and that is why I didn't want to tackle it right
away as part of this patch.

Thanks,
Sharad

> Richard.
>
>> I have bootstrapped and tested the attached patch on x86_64 and didn't
>> observe any new failures. Okay for trunk?
>>
>> Thanks,
>> Sharad

Attachment: opt-info-3.diff.bz2
Description: BZip2 compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]