Commit 9d9573d5 by Martin Liska Committed by Martin Liska

Simplify usage of some TDF_* flags.

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

	* cfg.c (check_bb_profile): Do not use TDF_COMMENT and print
	always leading ';; '.
	(dump_bb_info): Likewise.
	(brief_dump_cfg): Likewise.
	* cfgrtl.c (print_rtl_with_bb): Do not use TDF_COMMENT.
	* dumpfile.c: Remove usage of TDF_VERBOSE.
	* dumpfile.h (enum dump_kind): Likewise.
	(dump_gimple_bb_header): Do not use TDF_COMMENT.
	* print-tree.c (debug_verbose): Remove.
	* tree-cfg.c (gimple_dump_cfg): Do not use TDF_COMMENT.
	(dump_function_to_file): Remove dumps guarded with TDF_VERBOSE.
	* tree-diagnostic.c (default_tree_printer): Replace
	TDF_DIAGNOSTIC with TDF_SLIM.

From-SVN: r248514
parent f8d0706b
2017-05-26 Martin Liska <mliska@suse.cz>
* cfg.c (check_bb_profile): Do not use TDF_COMMENT and print
always leading ';; '.
(dump_bb_info): Likewise.
(brief_dump_cfg): Likewise.
* cfgrtl.c (print_rtl_with_bb): Do not use TDF_COMMENT.
* dumpfile.c: Remove usage of TDF_VERBOSE.
* dumpfile.h (enum dump_kind): Likewise.
(dump_gimple_bb_header): Do not use TDF_COMMENT.
* print-tree.c (debug_verbose): Remove.
* tree-cfg.c (gimple_dump_cfg): Do not use TDF_COMMENT.
(dump_function_to_file): Remove dumps guarded with TDF_VERBOSE.
* tree-diagnostic.c (default_tree_printer): Replace
TDF_DIAGNOSTIC with TDF_SLIM.
2017-05-26 Bin Cheng <bin.cheng@arm.com> 2017-05-26 Bin Cheng <bin.cheng@arm.com>
* tree-vect-loop-manip.c (create_intersect_range_checks_index): Pass * tree-vect-loop-manip.c (create_intersect_range_checks_index): Pass
......
...@@ -396,7 +396,7 @@ clear_bb_flags (void) ...@@ -396,7 +396,7 @@ clear_bb_flags (void)
It is still practical to have them reported for debugging of simple It is still practical to have them reported for debugging of simple
testcases. */ testcases. */
static void static void
check_bb_profile (basic_block bb, FILE * file, int indent, dump_flags_t flags) check_bb_profile (basic_block bb, FILE * file, int indent)
{ {
edge e; edge e;
int sum = 0; int sum = 0;
...@@ -425,17 +425,17 @@ check_bb_profile (basic_block bb, FILE * file, int indent, dump_flags_t flags) ...@@ -425,17 +425,17 @@ check_bb_profile (basic_block bb, FILE * file, int indent, dump_flags_t flags)
if (found) if (found)
{ {
if (EDGE_COUNT (bb->succs) && abs (sum - REG_BR_PROB_BASE) > 100) if (EDGE_COUNT (bb->succs) && abs (sum - REG_BR_PROB_BASE) > 100)
fprintf (file, "%s%sInvalid sum of outgoing probabilities %.1f%%\n", fprintf (file,
(flags & TDF_COMMENT) ? ";; " : "", s_indent, ";; %sInvalid sum of outgoing probabilities %.1f%%\n",
sum * 100.0 / REG_BR_PROB_BASE); s_indent, sum * 100.0 / REG_BR_PROB_BASE);
lsum = 0; lsum = 0;
FOR_EACH_EDGE (e, ei, bb->succs) FOR_EACH_EDGE (e, ei, bb->succs)
lsum += e->count; lsum += e->count;
if (EDGE_COUNT (bb->succs) if (EDGE_COUNT (bb->succs)
&& (lsum - bb->count > 100 || lsum - bb->count < -100)) && (lsum - bb->count > 100 || lsum - bb->count < -100))
fprintf (file, "%s%sInvalid sum of outgoing counts %i, should be %i\n", fprintf (file,
(flags & TDF_COMMENT) ? ";; " : "", s_indent, ";; %sInvalid sum of outgoing counts %i, should be %i\n",
(int) lsum, (int) bb->count); s_indent, (int) lsum, (int) bb->count);
} }
} }
if (bb != ENTRY_BLOCK_PTR_FOR_FN (fun)) if (bb != ENTRY_BLOCK_PTR_FOR_FN (fun))
...@@ -445,30 +445,28 @@ check_bb_profile (basic_block bb, FILE * file, int indent, dump_flags_t flags) ...@@ -445,30 +445,28 @@ check_bb_profile (basic_block bb, FILE * file, int indent, dump_flags_t flags)
sum += EDGE_FREQUENCY (e); sum += EDGE_FREQUENCY (e);
if (abs (sum - bb->frequency) > 100) if (abs (sum - bb->frequency) > 100)
fprintf (file, fprintf (file,
"%s%sInvalid sum of incoming frequencies %i, should be %i\n", ";; %sInvalid sum of incoming frequencies %i, should be %i\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent, s_indent, sum, bb->frequency);
sum, bb->frequency);
lsum = 0; lsum = 0;
FOR_EACH_EDGE (e, ei, bb->preds) FOR_EACH_EDGE (e, ei, bb->preds)
lsum += e->count; lsum += e->count;
if (lsum - bb->count > 100 || lsum - bb->count < -100) if (lsum - bb->count > 100 || lsum - bb->count < -100)
fprintf (file, "%s%sInvalid sum of incoming counts %i, should be %i\n", fprintf (file, ";; %sInvalid sum of incoming counts %i, should be %i\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent, s_indent, (int) lsum, (int) bb->count);
(int) lsum, (int) bb->count);
} }
if (BB_PARTITION (bb) == BB_COLD_PARTITION) if (BB_PARTITION (bb) == BB_COLD_PARTITION)
{ {
/* Warn about inconsistencies in the partitioning that are /* Warn about inconsistencies in the partitioning that are
currently caused by profile insanities created via optimization. */ currently caused by profile insanities created via optimization. */
if (!probably_never_executed_bb_p (fun, bb)) if (!probably_never_executed_bb_p (fun, bb))
fprintf (file, "%s%sBlock in cold partition with hot count\n", fprintf (file, ";; %sBlock in cold partition with hot count\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent); s_indent);
FOR_EACH_EDGE (e, ei, bb->preds) FOR_EACH_EDGE (e, ei, bb->preds)
{ {
if (!probably_never_executed_edge_p (fun, e)) if (!probably_never_executed_edge_p (fun, e))
fprintf (file, fprintf (file,
"%s%sBlock in cold partition with incoming hot edge\n", ";; %sBlock in cold partition with incoming hot edge\n",
(flags & TDF_COMMENT) ? ";; " : "", s_indent); s_indent);
} }
} }
} }
...@@ -737,8 +735,7 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags, ...@@ -737,8 +735,7 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags,
{ {
unsigned i; unsigned i;
if (flags & TDF_COMMENT) fputs (";; ", outf);
fputs (";; ", outf);
fprintf (outf, "%sbasic block %d, loop depth %d", fprintf (outf, "%sbasic block %d, loop depth %d",
s_indent, bb->index, bb_loop_depth (bb)); s_indent, bb->index, bb_loop_depth (bb));
if (flags & TDF_DETAILS) if (flags & TDF_DETAILS)
...@@ -756,9 +753,8 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags, ...@@ -756,9 +753,8 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags,
if (flags & TDF_DETAILS) if (flags & TDF_DETAILS)
{ {
check_bb_profile (bb, outf, indent, flags); check_bb_profile (bb, outf, indent);
if (flags & TDF_COMMENT) fputs (";; ", outf);
fputs (";; ", outf);
fprintf (outf, "%s prev block ", s_indent); fprintf (outf, "%s prev block ", s_indent);
if (bb->prev_bb) if (bb->prev_bb)
fprintf (outf, "%d", bb->prev_bb->index); fprintf (outf, "%d", bb->prev_bb->index);
...@@ -787,16 +783,14 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags, ...@@ -787,16 +783,14 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags,
fputc ('\n', outf); fputc ('\n', outf);
} }
if (flags & TDF_COMMENT) fputs (";; ", outf);
fputs (";; ", outf);
fprintf (outf, "%s pred: ", s_indent); fprintf (outf, "%s pred: ", s_indent);
first = true; first = true;
FOR_EACH_EDGE (e, ei, bb->preds) FOR_EACH_EDGE (e, ei, bb->preds)
{ {
if (! first) if (! first)
{ {
if (flags & TDF_COMMENT) fputs (";; ", outf);
fputs (";; ", outf);
fprintf (outf, "%s ", s_indent); fprintf (outf, "%s ", s_indent);
} }
first = false; first = false;
...@@ -809,16 +803,14 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags, ...@@ -809,16 +803,14 @@ dump_bb_info (FILE *outf, basic_block bb, int indent, dump_flags_t flags,
if (do_footer) if (do_footer)
{ {
if (flags & TDF_COMMENT) fputs (";; ", outf);
fputs (";; ", outf);
fprintf (outf, "%s succ: ", s_indent); fprintf (outf, "%s succ: ", s_indent);
first = true; first = true;
FOR_EACH_EDGE (e, ei, bb->succs) FOR_EACH_EDGE (e, ei, bb->succs)
{ {
if (! first) if (! first)
{ {
if (flags & TDF_COMMENT) fputs (";; ", outf);
fputs (";; ", outf);
fprintf (outf, "%s ", s_indent); fprintf (outf, "%s ", s_indent);
} }
first = false; first = false;
...@@ -839,9 +831,7 @@ brief_dump_cfg (FILE *file, dump_flags_t flags) ...@@ -839,9 +831,7 @@ brief_dump_cfg (FILE *file, dump_flags_t flags)
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
dump_bb_info (file, bb, 0, dump_bb_info (file, bb, 0, flags & TDF_DETAILS, true, true);
flags & (TDF_COMMENT | TDF_DETAILS),
true, true);
} }
} }
......
...@@ -2207,7 +2207,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags) ...@@ -2207,7 +2207,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags)
bb = start[INSN_UID (tmp_rtx)]; bb = start[INSN_UID (tmp_rtx)];
if (bb != NULL) if (bb != NULL)
{ {
dump_bb_info (outf, bb, 0, dump_flags | TDF_COMMENT, true, false); dump_bb_info (outf, bb, 0, dump_flags, true, false);
if (df && (flags & TDF_DETAILS)) if (df && (flags & TDF_DETAILS))
df_dump_top (bb, outf); df_dump_top (bb, outf);
} }
...@@ -2234,7 +2234,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags) ...@@ -2234,7 +2234,7 @@ print_rtl_with_bb (FILE *outf, const rtx_insn *rtx_first, dump_flags_t flags)
bb = end[INSN_UID (tmp_rtx)]; bb = end[INSN_UID (tmp_rtx)];
if (bb != NULL) if (bb != NULL)
{ {
dump_bb_info (outf, bb, 0, dump_flags | TDF_COMMENT, false, true); dump_bb_info (outf, bb, 0, dump_flags, false, true);
if (df && (flags & TDF_DETAILS)) if (df && (flags & TDF_DETAILS))
df_dump_bottom (bb, outf); df_dump_bottom (bb, outf);
putc ('\n', outf); putc ('\n', outf);
......
...@@ -111,7 +111,6 @@ static const struct dump_option_value_info dump_options[] = ...@@ -111,7 +111,6 @@ static const struct dump_option_value_info dump_options[] =
{"uid", TDF_UID}, {"uid", TDF_UID},
{"stmtaddr", TDF_STMTADDR}, {"stmtaddr", TDF_STMTADDR},
{"memsyms", TDF_MEMSYMS}, {"memsyms", TDF_MEMSYMS},
{"verbose", TDF_VERBOSE},
{"eh", TDF_EH}, {"eh", TDF_EH},
{"alias", TDF_ALIAS}, {"alias", TDF_ALIAS},
{"nouid", TDF_NOUID}, {"nouid", TDF_NOUID},
...@@ -123,8 +122,7 @@ static const struct dump_option_value_info dump_options[] = ...@@ -123,8 +122,7 @@ static const struct dump_option_value_info dump_options[] =
{"missed", MSG_MISSED_OPTIMIZATION}, {"missed", MSG_MISSED_OPTIMIZATION},
{"note", MSG_NOTE}, {"note", MSG_NOTE},
{"optall", MSG_ALL}, {"optall", MSG_ALL},
{"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_GRAPH | TDF_STMTADDR
| TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
| TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV
| TDF_GIMPLE)}, | TDF_GIMPLE)},
{NULL, 0} {NULL, 0}
......
...@@ -70,16 +70,12 @@ enum dump_kind ...@@ -70,16 +70,12 @@ enum dump_kind
#define TDF_LINENO (1 << 10) /* display statement line numbers */ #define TDF_LINENO (1 << 10) /* display statement line numbers */
#define TDF_UID (1 << 11) /* display decl UIDs */ #define TDF_UID (1 << 11) /* display decl UIDs */
#define TDF_STMTADDR (1 << 12) /* Address of stmt. */ #define TDF_STMTADDR (1 << 12) /* Address of stmt. */
#define TDF_GRAPH (1 << 13) /* a graph dump is being emitted */ #define TDF_GRAPH (1 << 13) /* a graph dump is being emitted */
#define TDF_MEMSYMS (1 << 14) /* display memory symbols in expr. #define TDF_MEMSYMS (1 << 14) /* display memory symbols in expr.
Implies TDF_VOPS. */ Implies TDF_VOPS. */
#define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
message. */
#define TDF_VERBOSE (1 << 16) /* A dump that uses the full tree
dumper to print stmts. */
#define TDF_RHS_ONLY (1 << 17) /* a flag to only print the RHS of #define TDF_RHS_ONLY (1 << 17) /* a flag to only print the RHS of
a gimple stmt. */ a gimple stmt. */
#define TDF_ASMNAME (1 << 18) /* display asm names of decls */ #define TDF_ASMNAME (1 << 18) /* display asm names of decls */
...@@ -90,7 +86,6 @@ enum dump_kind ...@@ -90,7 +86,6 @@ enum dump_kind
#define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */ #define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */
#define TDF_CSELIB (1 << 23) /* Dump cselib details. */ #define TDF_CSELIB (1 << 23) /* Dump cselib details. */
#define TDF_SCEV (1 << 24) /* Dump SCEV details. */ #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_GIMPLE (1 << 26) /* Dump in GIMPLE FE syntax */
#define TDF_FOLDING (1 << 27) /* Dump folding details. */ #define TDF_FOLDING (1 << 27) /* Dump folding details. */
#define MSG_OPTIMIZED_LOCATIONS (1 << 27) /* -fopt-info optimized sources */ #define MSG_OPTIMIZED_LOCATIONS (1 << 27) /* -fopt-info optimized sources */
......
...@@ -2641,8 +2641,7 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, ...@@ -2641,8 +2641,7 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent,
{ {
gimple_stmt_iterator gsi; gimple_stmt_iterator gsi;
if (flags & TDF_COMMENT) fputs (";; ", outf);
fputs (";; ", outf);
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
if (!is_gimple_debug (gsi_stmt (gsi)) if (!is_gimple_debug (gsi_stmt (gsi))
......
...@@ -1038,21 +1038,6 @@ debug (const tree_node *ptr) ...@@ -1038,21 +1038,6 @@ debug (const tree_node *ptr)
} }
DEBUG_FUNCTION void DEBUG_FUNCTION void
debug_verbose (const tree_node &ref)
{
dump_tree_via_hooks (&ref, TDF_VERBOSE);
}
DEBUG_FUNCTION void
debug_verbose (const tree_node *ptr)
{
if (ptr)
debug_verbose (*ptr);
else
fprintf (stderr, "<nil>\n");
}
DEBUG_FUNCTION void
debug_head (const tree_node &ref) debug_head (const tree_node &ref)
{ {
debug (ref); debug (ref);
......
...@@ -2401,7 +2401,7 @@ gimple_dump_cfg (FILE *file, dump_flags_t flags) ...@@ -2401,7 +2401,7 @@ gimple_dump_cfg (FILE *file, dump_flags_t flags)
n_basic_blocks_for_fn (cfun), n_edges_for_fn (cfun), n_basic_blocks_for_fn (cfun), n_edges_for_fn (cfun),
last_basic_block_for_fn (cfun)); last_basic_block_for_fn (cfun));
brief_dump_cfg (file, flags | TDF_COMMENT); brief_dump_cfg (file, flags);
fprintf (file, "\n"); fprintf (file, "\n");
} }
...@@ -7591,17 +7591,12 @@ dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags) ...@@ -7591,17 +7591,12 @@ dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags)
print_generic_expr (file, TREE_TYPE (arg), dump_flags); print_generic_expr (file, TREE_TYPE (arg), dump_flags);
fprintf (file, " "); fprintf (file, " ");
print_generic_expr (file, arg, dump_flags); print_generic_expr (file, arg, dump_flags);
if (flags & TDF_VERBOSE)
print_node (file, "", arg, 4);
if (DECL_CHAIN (arg)) if (DECL_CHAIN (arg))
fprintf (file, ", "); fprintf (file, ", ");
arg = DECL_CHAIN (arg); arg = DECL_CHAIN (arg);
} }
fprintf (file, ")\n"); fprintf (file, ")\n");
if (flags & TDF_VERBOSE)
print_node (file, "", fndecl, 2);
dsf = DECL_STRUCT_FUNCTION (fndecl); dsf = DECL_STRUCT_FUNCTION (fndecl);
if (dsf && (flags & TDF_EH)) if (dsf && (flags & TDF_EH))
dump_eh_tree (file, dsf); dump_eh_tree (file, dsf);
...@@ -7654,8 +7649,6 @@ dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags) ...@@ -7654,8 +7649,6 @@ dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags)
FOR_EACH_LOCAL_DECL (fun, ix, var) FOR_EACH_LOCAL_DECL (fun, ix, var)
{ {
print_generic_decl (file, var, flags); print_generic_decl (file, var, flags);
if (flags & TDF_VERBOSE)
print_node (file, "", var, 4);
fprintf (file, "\n"); fprintf (file, "\n");
any_var = true; any_var = true;
...@@ -7691,7 +7684,7 @@ dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags) ...@@ -7691,7 +7684,7 @@ dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags)
fprintf (file, "\n"); fprintf (file, "\n");
FOR_EACH_BB_FN (bb, fun) FOR_EACH_BB_FN (bb, fun)
dump_bb (file, bb, 2, flags | TDF_COMMENT); dump_bb (file, bb, 2, flags);
fprintf (file, "}\n"); fprintf (file, "}\n");
} }
......
...@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h" #include "diagnostic.h"
#include "tree-pretty-print.h" #include "tree-pretty-print.h"
#include "tree-diagnostic.h" #include "tree-diagnostic.h"
#include "dumpfile.h" /* TDF_DIAGNOSTIC */
#include "langhooks.h" #include "langhooks.h"
#include "intl.h" #include "intl.h"
...@@ -294,7 +293,7 @@ default_tree_printer (pretty_printer *pp, text_info *text, const char *spec, ...@@ -294,7 +293,7 @@ default_tree_printer (pretty_printer *pp, text_info *text, const char *spec,
pp_string (pp, n); pp_string (pp, n);
} }
else else
dump_generic_node (pp, t, 0, TDF_DIAGNOSTIC, 0); dump_generic_node (pp, t, 0, TDF_SLIM, 0);
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment