diff mbox

genemit: Print name of splitter to dumpfile

Message ID 3e6eee2a9977e9f18dc654f54f3199e8ee953219.1408320228.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool Aug. 18, 2014, 12:15 a.m. UTC
Currently, the splitter dumpfiles only say "scanning new insn with uid = N."
and "deleting insn with uid = N.".  This makes it hard to track down which
splitter actually fired, especially so if there are many similar splitters
and one is slightly broken.

This patch makes the splitters write their name to the dumpfile when they
are called.  As a side benefit it also becomes obvious in the dumpfiles
what "new insn"s belong together with what "deleting insn"s.

Bootstrapped and regression tested on powerpc64-linux, no new failures;
is this okay for mainline?


Segher

---
 gcc/genemit.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jeff Law Aug. 27, 2014, 9:29 p.m. UTC | #1
On 08/17/14 18:15, Segher Boessenkool wrote:
> Currently, the splitter dumpfiles only say "scanning new insn with uid = N."
> and "deleting insn with uid = N.".  This makes it hard to track down which
> splitter actually fired, especially so if there are many similar splitters
> and one is slightly broken.
>
> This patch makes the splitters write their name to the dumpfile when they
> are called.  As a side benefit it also becomes obvious in the dumpfiles
> what "new insn"s belong together with what "deleting insn"s.
>
> Bootstrapped and regression tested on powerpc64-linux, no new failures;
> is this okay for mainline?
OK once you add a ChangeLog entry.

Jeff
Segher Boessenkool Sept. 1, 2014, 2:30 p.m. UTC | #2
On Wed, Aug 27, 2014 at 03:29:40PM -0600, Jeff Law wrote:
> OK once you add a ChangeLog entry.

Thanks.  Erm, yes.  Committed with this ChangeLog:


2014-09-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* genemit.c: Include dumpfile.h.
	(gen_split): Print name of splitter function to dump file.


Segher
diff mbox

Patch

diff --git a/gcc/genemit.c b/gcc/genemit.c
index 16b5644..55e7372 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -578,6 +578,10 @@  gen_split (rtx split)
   if (GET_CODE (split) == DEFINE_PEEPHOLE2)
     output_peephole2_scratches (split);
 
+  printf ("  if (dump_file)\n");
+  printf ("    fprintf (dump_file, \"Splitting with gen_%s_%d\\n\");\n",
+	  name, insn_code_number);
+
   printf ("  start_sequence ();\n");
 
   /* The fourth operand of DEFINE_SPLIT is some code to be executed
@@ -813,6 +817,7 @@  from the machine description file `md'.  */\n\n");
   printf ("#include \"tm-constrs.h\"\n");
   printf ("#include \"ggc.h\"\n");
   printf ("#include \"basic-block.h\"\n");
+  printf ("#include \"dumpfile.h\"\n");
   printf ("#include \"target.h\"\n\n");
   printf ("#define FAIL return (end_sequence (), _val)\n");
   printf ("#define DONE return (_val = get_insns (), end_sequence (), _val)\n\n");