Hello. After discussions with Richi, I decided to end up with the transformation and thus I would like to apply the original patch on top of what was done. Probably last change should be that we should renumber TDF_* values to start from 1 << 0 and holes in numbering should be eliminated?
Thanks, Martin
>From d0cab884035be37e5ceab54384611830661fdd9f Mon Sep 17 00:00:00 2001 From: marxin <mli...@suse.cz> Date: Wed, 24 May 2017 10:32:42 +0200 Subject: [PATCH] Add -fdump*-folding suboption. gcc/ChangeLog: 2017-05-24 Martin Liska <mli...@suse.cz> * dumpfile.c: Add TDF_FOLDING. * dumpfile.h (enum dump_kind): Likewise. * genmatch.c (dt_simplify::gen_1): Use it. --- gcc/dumpfile.c | 1 + gcc/dumpfile.h | 1 + gcc/genmatch.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 13a711345b4..903d879e784 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -118,6 +118,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 a1e4720156d..abb4d93a93b 100644 --- a/gcc/dumpfile.h +++ b/gcc/dumpfile.h @@ -92,6 +92,7 @@ enum dump_kind #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 TDF_FOLDING (1 << 27) /* Dump folding details. */ #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 */ diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 2c3183b25af..f20e39f9158 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -3191,7 +3191,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