public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RFC][PATCH] Introduce -fdump*-folding
@ 2017-05-03  8:14 Martin Liška
  2017-05-03  8:20 ` Andrew Pinski
  2017-05-03 10:16 ` Richard Biener
  0 siblings, 2 replies; 54+ messages in thread
From: Martin Liška @ 2017-05-03  8:14 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener

[-- Attachment #1: Type: text/plain, Size: 1912 bytes --]

Hello

Last release cycle I spent quite some time with reading of IVOPTS pass
dump file. Using -fdump*-details causes to generate a lot of 'Applying pattern'
lines, which can make reading of a dump file more complicated.

There are stats for tramp3d with -O2 and -fdump-tree-all-details. Percentage number
shows how many lines are of the aforementioned pattern:

                        tramp3d-v4.cpp.164t.ivopts: 6.34%
                          tramp3d-v4.cpp.091t.ccp2: 5.04%
                      tramp3d-v4.cpp.093t.cunrolli: 4.41%
                      tramp3d-v4.cpp.129t.laddress: 3.70%
                          tramp3d-v4.cpp.032t.ccp1: 2.31%
                          tramp3d-v4.cpp.038t.evrp: 1.90%
                     tramp3d-v4.cpp.033t.forwprop1: 1.74%
                          tramp3d-v4.cpp.103t.vrp1: 1.52%
                     tramp3d-v4.cpp.124t.forwprop3: 1.31%
                          tramp3d-v4.cpp.181t.vrp2: 1.30%
                       tramp3d-v4.cpp.161t.cunroll: 1.22%
                    tramp3d-v4.cpp.027t.fixup_cfg3: 1.11%
                       tramp3d-v4.cpp.153t.ivcanon: 1.07%
                          tramp3d-v4.cpp.126t.ccp3: 0.96%
                          tramp3d-v4.cpp.143t.sccp: 0.91%
                     tramp3d-v4.cpp.185t.forwprop4: 0.82%
                           tramp3d-v4.cpp.011t.cfg: 0.74%
                     tramp3d-v4.cpp.096t.forwprop2: 0.50%
                    tramp3d-v4.cpp.019t.fixup_cfg1: 0.37%
                     tramp3d-v4.cpp.120t.phicprop1: 0.33%
                           tramp3d-v4.cpp.133t.pre: 0.32%
                     tramp3d-v4.cpp.182t.phicprop2: 0.27%
                    tramp3d-v4.cpp.170t.veclower21: 0.25%
                       tramp3d-v4.cpp.029t.einline: 0.24%

I'm suggesting to add new TDF that will be allocated for that.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Thoughts?
Martin

[-- Attachment #2: 0001-Introduce-fdump-folding.patch --]
[-- Type: text/x-patch, Size: 2483 bytes --]

From c1b832212576fd9f89fd738ae0cc98e9fb189c1d Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 1 Feb 2017 15:34:52 +0100
Subject: [PATCH] Introduce -fdump*-folding

gcc/ChangeLog:

2017-05-03  Martin Liska  <mliska@suse.cz>

	* dumpfile.c: Add TDF_FOLDING.
	* dumpfile.h (enum tree_dump_index): Add to the enum.
	* genmatch.c (dt_simplify::gen_1): Use the newly added enum
	value.
---
 gcc/dumpfile.c | 1 +
 gcc/dumpfile.h | 7 ++++---
 gcc/genmatch.c | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index 6b9a47c5a26..b9c881c103f 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -111,6 +111,7 @@ static const struct dump_option_value_info dump_options[] =
   {"enumerate_locals", TDF_ENUMERATE_LOCALS},
   {"scev", TDF_SCEV},
   {"gimple", TDF_GIMPLE},
+  {"folding", TDF_FOLDING},
   {"optimized", MSG_OPTIMIZED_LOCATIONS},
   {"missed", MSG_MISSED_OPTIMIZATION},
   {"note", MSG_NOTE},
diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h
index fef58f5e9b1..69c4ec0f861 100644
--- a/gcc/dumpfile.h
+++ b/gcc/dumpfile.h
@@ -84,9 +84,10 @@ enum tree_dump_index
 #define TDF_SCEV	(1 << 24)	/* Dump SCEV details.  */
 #define TDF_COMMENT	(1 << 25)	/* Dump lines with prefix ";;"  */
 #define TDF_GIMPLE	(1 << 26)	/* Dump in GIMPLE FE syntax  */
-#define MSG_OPTIMIZED_LOCATIONS  (1 << 27)  /* -fopt-info optimized sources */
-#define MSG_MISSED_OPTIMIZATION  (1 << 28)  /* missed opportunities */
-#define MSG_NOTE                 (1 << 29)  /* general optimization info */
+#define TDF_FOLDING	(1 << 27)	/* Dump folding details.  */
+#define MSG_OPTIMIZED_LOCATIONS  (1 << 28)  /* -fopt-info optimized sources */
+#define MSG_MISSED_OPTIMIZATION  (1 << 29)  /* missed opportunities */
+#define MSG_NOTE                 (1 << 30)  /* general optimization info */
 #define MSG_ALL         (MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION \
                          | MSG_NOTE)
 
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 5621aa05b59..979d6856084 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -3187,7 +3187,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result)
 	}
     }
 
-  fprintf_indent (f, indent, "if (dump_file && (dump_flags & TDF_DETAILS)) "
+  fprintf_indent (f, indent, "if (dump_file && (dump_flags & TDF_FOLDING)) "
 	   "fprintf (dump_file, \"Applying pattern ");
   output_line_directive (f,
 			 result ? result->location : s->match->location, true);
-- 
2.12.2


^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2017-05-30 11:30 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03  8:14 [RFC][PATCH] Introduce -fdump*-folding Martin Liška
2017-05-03  8:20 ` Andrew Pinski
2017-05-03 10:16 ` Richard Biener
2017-05-04  9:23   ` Martin Liška
2017-05-04 10:41     ` Richard Biener
2017-05-04 12:06       ` Martin Liška
2017-05-05 10:44         ` [PATCH 1/N] Introduce dump_flags_t type and use it instead of int type Martin Liška
2017-05-05 11:50           ` Richard Biener
2017-05-06 15:04             ` Trevor Saunders
2017-05-12 13:01               ` [PATCH v2 01/N] Add default value for last argument of dump functions Martin Liška
2017-05-16 13:49                 ` Richard Biener
2017-05-12 13:04               ` [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type Martin Liška
2017-05-16 13:50                 ` Richard Biener
2017-05-16 14:56                   ` Martin Liška
2017-05-17  7:55                     ` Richard Biener
2017-05-17  9:06                       ` Martin Liška
2017-05-18 13:37                         ` Thomas Schwinge
2017-05-18 14:26                           ` Martin Liška
2017-05-12 13:30               ` [PATCH v2 3/N] Transform TDF_{lang,tree,ipa,rtl} to dump_kind enum Martin Liška
2017-05-16 14:17                 ` Richard Biener
2017-05-17 12:22                 ` Richard Biener
2017-05-18 12:37                   ` Martin Liška
2017-05-25  5:29                 ` Martin Sebor
2017-05-25  9:56                   ` Martin Liška
2017-05-25 10:58                     ` Nathan Sidwell
2017-05-26 13:00                     ` Richard Biener
2017-05-26 13:54                       ` Martin Liška
2017-05-30 11:46                         ` Richard Biener
2017-05-16 13:55               ` [PATCH v2 04/N] Simplify usage of some TDF_* flags Martin Liška
2017-05-17 12:37                 ` Richard Biener
2017-05-18 12:58                   ` Martin Liška
2017-05-24 21:23                     ` Martin Liška
2017-05-26 11:46                       ` Richard Biener
2017-05-24 11:04               ` [PATCH v2 05/N] Add -fdump*-folding suboption Martin Liška
2017-05-24 13:53                 ` Richard Biener
2017-05-05 10:56         ` [PATCH 2/N] Add dump_flags_type<E> for handling of suboptions Martin Liška
2017-05-09 12:05           ` Martin Liška
2017-05-12 17:47           ` Martin Sebor
2017-05-15  6:52             ` Martin Sebor
2017-05-15  9:47           ` [RFC] Do we want hierarchical options & encapsulation in a class Martin Liška
2017-05-15 11:26             ` Nathan Sidwell
2017-05-15 12:24               ` Martin Liška
2017-05-15 11:46             ` Nathan Sidwell
2017-05-15 12:05               ` Martin Liška
2017-05-15 12:43                 ` Nathan Sidwell
2017-05-15 13:50                   ` Martin Liška
2017-05-15 14:13                     ` Nathan Sidwell
2017-05-15 14:24                       ` Martin Liška
2017-05-16 13:44                         ` Richard Biener
2017-05-05 11:57         ` [RFC][PATCH] Introduce -fdump*-folding Richard Biener
2017-05-09 12:03           ` Martin Liška
2017-05-09 12:19             ` Richard Biener
2017-05-09 12:52               ` Martin Liška
2017-05-09 13:01                 ` Richard Biener

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).