This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC][PATCH] Introduce -fdump*-folding
- From: Martin Liška <mliska at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Biener <richard dot guenther at gmail dot com>
- Date: Wed, 3 May 2017 10:10:44 +0200
- Subject: [RFC][PATCH] Introduce -fdump*-folding
- Authentication-results: sourceware.org; auth=none
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
>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