public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 0/5] dump_printf support for middle-end types
Date: Tue, 31 Jul 2018 14:01:00 -0000	[thread overview]
Message-ID: <1533045607.22345.152.camel@redhat.com> (raw)
In-Reply-To: <CAFiYyc3r9N6aeFb-dFtiE_=BTrYxpj+4WB26ENo1KPUz7GMO4g@mail.gmail.com>

On Tue, 2018-07-31 at 14:50 +0200, Richard Biener wrote:
> On Fri, Jul 27, 2018 at 11:47 PM David Malcolm <dmalcolm@redhat.com>
> wrote:
> > 
> > This patch kit converts dump_print and dump_printf_loc from using
> > fprintf etc internally to using a new pretty-printer
> > based on pp_format, which supports formatting middle-end types.
> > 
> > In particular, the following codes are implemented (in addition
> > to the standard pretty_printer ones):
> > 
> >    %E: gimple *:
> >        Equivalent to: dump_gimple_expr (MSG_*, TDF_SLIM, stmt, 0)
> >    %G: gimple *:
> >        Equivalent to: dump_gimple_stmt (MSG_*, TDF_SLIM, stmt, 0)
> >    %T: tree:
> >        Equivalent to: dump_generic_expr (MSG_*, arg, TDF_SLIM).
> > 
> > Hence it becomes possible to convert e.g.:
> > 
> >   if (dump_enabled_p ())
> >     {
> >       dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
> >                        "not vectorized: different sized vector "
> >                        "types in statement, ");
> >       dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
> > vectype);
> >       dump_printf (MSG_MISSED_OPTIMIZATION, " and ");
> >       dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
> > nunits_vectype);
> >       dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
> >     }
> >   return false;
> > 
> > into a single call to dump_printf_loc:
> > 
> >   if (dump_enabled_p ())
> >     dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
> >                      "not vectorized: different sized vector "
> >                      "types in statement, %T and %T\n",
> >                      vectype, nunits_vectype);
> >   return false;
> > 
> > Unlike regular pretty-printers, this captures metadata for the
> > formatted chunks as appropriate, so that when written out to a
> > JSON optimization record, the relevant parts of the message are
> > labelled by type, and by source location (so that
> > e.g. %G is entirely equivalent to using dump_gimple_stmt).
> > 
> > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> > 
> > OK for trunk?
> 
> Nice!  I'm somehow missing 3/5?  Will look into the other ones now.

Thanks.

FWIW, 3/5 was:
  "[PATCH 3/5] C++: clean up cp_printer"
     https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01766.html

which Jason has already approved (and I've committed as r263046, after
a fresh bootstrap&regrtest).

Dave

> Richard.
> 
> > I'm hoping to use this in a v3 of:
> >   "[PATCH 0/5] [RFC v2] Higher-level reporting of vectorization
> > problems"
> >      https://gcc.gnu.org/ml/gcc-patches/2018-07/msg00446.html
> > where the above might become:
> >   return opt_result::failure_at (stmt,
> >                                  "not vectorized: different sized
> > vector "
> >                                  "types in statement, %T and %T\n",
> >                                  vectype, nunits_vectype);
> > where opt_result::failure_at would encapsulate the "false", and
> > capture an opt_problem * (when dumps are enabled), for the reasons
> > discussed in that other kit.
> > 
> > David Malcolm (5):
> >   Simplify dump_context by adding a dump_loc member function
> >   dumpfile.c: eliminate special-casing of dump_file/alt_dump_file
> >   C++: clean up cp_printer
> >   c-family: clean up the data tables in c-format.c
> >   Formatted printing for dump_* in the middle-end
> > 
> >  gcc/c-family/c-format.c                   |  159 +++--
> >  gcc/c-family/c-format.h                   |    1 +
> >  gcc/cp/error.c                            |   46 +-
> >  gcc/dump-context.h                        |   25 +-
> >  gcc/dumpfile.c                            | 1011
> > ++++++++++++++++++++++-------
> >  gcc/dumpfile.h                            |   54 +-
> >  gcc/optinfo-emit-json.cc                  |    2 +-
> >  gcc/optinfo.cc                            |  135 +---
> >  gcc/optinfo.h                             |   38 +-
> >  gcc/testsuite/gcc.dg/format/gcc_diag-1.c  |   19 +-
> >  gcc/testsuite/gcc.dg/format/gcc_diag-10.c |   33 +-
> >  11 files changed, 998 insertions(+), 525 deletions(-)
> > 
> > --
> > 1.8.5.3
> > 

      reply	other threads:[~2018-07-31 14:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 21:47 David Malcolm
2018-07-27 21:47 ` [PATCH 1/5] Simplify dump_context by adding a dump_loc member function David Malcolm
2018-07-31 12:51   ` Richard Biener
2018-07-27 21:47 ` [PATCH 5/5] Formatted printing for dump_* in the middle-end David Malcolm
2018-07-31 13:03   ` Richard Biener
2018-07-31 14:19     ` David Malcolm
2018-07-31 14:21       ` Richard Biener
2018-07-31 14:33         ` Richard Biener
2018-07-31 19:56       ` Joseph Myers
2018-08-02 17:09         ` [PATCH] v2: " David Malcolm
2018-08-09 22:11           ` Joseph Myers
2018-08-17  4:08           ` Jeff Law
2018-08-17 18:24             ` David Malcolm
2018-08-27  6:58           ` Jakub Jelinek
2018-08-27 23:46             ` [PATCH] Fix version check for ATTRIBUTE_GCC_DUMP_PRINTF David Malcolm
2018-08-28  6:44               ` Jakub Jelinek
2018-08-28 12:26                 ` Jakub Jelinek
2018-08-28 14:19                   ` David Malcolm
2018-07-27 21:47 ` [PATCH 2/5] dumpfile.c: eliminate special-casing of dump_file/alt_dump_file David Malcolm
2018-07-31 12:54   ` Richard Biener
2018-07-31 15:34     ` David Malcolm
2018-07-31 15:37       ` Richard Biener
2018-07-27 21:47 ` [PATCH 4/5] c-family: clean up the data tables in c-format.c David Malcolm
2018-07-31 12:56   ` Richard Biener
2018-07-31 13:08     ` Marek Polacek
2018-07-27 21:47 ` [PATCH 3/5] C++: clean up cp_printer David Malcolm
2018-07-28 14:06   ` Jason Merrill
2018-07-31 12:50 ` [PATCH 0/5] dump_printf support for middle-end types Richard Biener
2018-07-31 14:01   ` David Malcolm [this message]

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=1533045607.22345.152.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).