This is the mail archive of the gcc@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]

New dump infrastructure


Hi,

This is a solicitation for help in converting passes to use the new
dump infrastructure. More context below.

I have enhanced the dump infrastructure in r191883, r191884. These
patches updated the tree/rtl dump facility so that passes do not
reference the dump file directly, but instead use a different (and
hopefully cleaner) API.

Instead of this

    if (dump_file)
      fprintf (dump_file, ...);

the new style looks like this

    if (dump_kind_p (...))
      dump_printf (...)

In addition, I also added a new option -fopt-info. This option allows
one to focus on high-level optimizations without scanning lots of
verbose tree/rtl dump files. Currently, the following categories of
optimization info are defined in dumpfile.c:

MSG_OPTIMIZED_LOCATIONS   /* -fopt-info optimized sources */
MSG_MISSED_OPTIMIZATION   /* missed opportunities */
MSG_NOTE                  /* general optimization info */
MSG_ALL                   /* Dump all available info */

The same dump API works for both regular dumps as well as -fopt-info
dumps. This is because the dump_kind_p () accepts a union of dump
flags. These flags include all of the TDF_* flags as well as newly
designed MSG_* flags.

For example, one could say

    if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS | TDF_BLOCKS))
      dump_printf (...);

This means that dump the info if either the -fopt-info-optimized or
-ftree-<pass>-blocks options is given. The dump files for these dumps
could be different, but individual passes do not need to worry about
that. It is handled transparently.

Another feature is that this new dump infrastructure allows dumps to
be redirected into command line named files (including stderr/stdout)
instead of auto generated filenames.

Since the number of existing dump call sites is quite large, currently
both old *and* new schemes are in use. The plan is to gradually
transition passes to use the new dump infrastructure and deprecate the
old dump style. This will also provide better optimization reports in
future.

Now I am asking for help. :)

Thus far I have converted the vectorization passes to use the new dump
scheme and output optimization details using -fopt-info. However, all
other passes need help. It would be great if you could help convert
your favorite pass (or two).

Thanks,
Sharad


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