From: Richard Biener <richard.guenther@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] Dump BB number when dumping a BB with label.
Date: Fri, 28 Jul 2017 07:21:00 -0000 [thread overview]
Message-ID: <CAFiYyc2=65hNsY+XA3s4pytoDM_ozepsDT=Rp8aksq=7mm8K=w@mail.gmail.com> (raw)
In-Reply-To: <09f05b6e-99bd-0238-e39b-185c5df95fe5@suse.cz>
On Thu, Jul 27, 2017 at 4:24 PM, Martin Liška <mliska@suse.cz> wrote:
> Hi.
>
> Following simple patch adds support for dumping of BBs when it's a BB
> that contains a label. That makes it easier for debugging as one can
> find destination for an edge in dump file.
>
> Sample, before:
>
> foo (int a)
> {
> int D.1821;
> int _1;
> int _4;
> int _5;
>
> <bb 2> [0.00%] [count: INV]:
> switch (a_2(D)) <default: <L2> [INV] [count: INV], case 0: <L0> [INV] [count: INV], case 1: <L1> [INV] [count: INV]>
>
> <L0> [0.00%] [count: INV]:
> a_3 = a_2(D) + 2;
>
> <L1> [0.00%] [count: INV]:
> _4 = 2;
> goto <bb 6> (<L3>); [INV] [count: INV]
>
> <L2> [0.00%] [count: INV]:
> _5 = 123;
>
> # _1 = PHI <_4(4), _5(5)>
> <L3> [0.00%] [count: INV]:
> return _1;
>
> }
>
> After:
>
> foo (int a)
> {
> int D.1821;
> int _1;
> int _4;
> int _5;
>
> <bb 2> [0.00%] [count: INV]:
> switch (a_2(D)) <default: <L2> [INV] [count: INV], case 0: <L0> [INV] [count: INV], case 1: <L1> [INV] [count: INV]>
>
> <L0> (<bb 3>) [0.00%] [count: INV]:
> a_3 = a_2(D) + 2;
>
> <L1> (<bb 4>) [0.00%] [count: INV]:
> _4 = 2;
> goto <bb 6> (<L3>); [INV] [count: INV]
>
> <L2> (<bb 5>) [0.00%] [count: INV]:
> _5 = 123;
>
> # _1 = PHI <_4(4), _5(5)>
> <L3> (<bb 6>) [0.00%] [count: INV]:
> return _1;
>
> }
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Thoughts?
I think I prefer to always see
<bb 3> ....:
and if there's a label just dump that as well, thus
<bb 3> ....:
L0:
I think that's how we dump the case with multiple labels. And always use the
implicit bb N when dumping destinations (in gotos, switches, etc).
That is, what we have now is IMHO premature prettifying losing BB
indices in the dumps
unnecessarily.
Richard.
> Martin
>
> gcc/testsuite/ChangeLog:
>
> 2017-07-27 Martin Liska <mliska@suse.cz>
>
> * gcc.dg/builtin-unreachable-6.c: Update scanned pattern.
> * gcc.dg/tree-ssa/attr-hotcold-2.c: Likewise.
> * gcc.dg/tree-ssa/ssa-ccp-18.c: Likewise.
>
> gcc/ChangeLog:
>
> 2017-07-27 Martin Liska <mliska@suse.cz>
>
> * gimple-pretty-print.c (dump_gimple_label): Dump BB number.
> ---
> gcc/gimple-pretty-print.c | 6 +++++-
> gcc/testsuite/gcc.dg/builtin-unreachable-6.c | 2 +-
> gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c | 4 ++--
> gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-18.c | 3 +--
> 4 files changed, 9 insertions(+), 6 deletions(-)
>
>
next prev parent reply other threads:[~2017-07-28 7:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-27 14:24 Martin Liška
2017-07-28 7:21 ` Richard Biener [this message]
2017-07-28 7:50 ` Martin Liška
2017-07-28 7:58 ` Richard Biener
2017-07-28 10:53 ` Martin Liška
2017-07-28 11:21 ` Richard Biener
2017-07-31 6:44 ` [PATCH v2] " Martin Liška
2017-07-31 8:50 ` Richard Biener
2017-07-31 8:53 ` Martin Liška
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='CAFiYyc2=65hNsY+XA3s4pytoDM_ozepsDT=Rp8aksq=7mm8K=w@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=mliska@suse.cz \
/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).