From: Richard Guenther Date: Wed, 29 Jun 2011 14:29:22 +0000 (+0000) Subject: invoke.texi: Document -scev dump modifier. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dfedbe40550d1d5302ff20cf21d9ae5cc89921d5;p=gcc.git invoke.texi: Document -scev dump modifier. 2011-06-29 Richard Guenther * doc/invoke.texi: Document -scev dump modifier. * tree-pass.h (TDF_SCEV): New dump flag. * tree-dump.c (dump_option_value_in): Add scev. * tree-chrec.c: Replace all TDF_DETAILS checks with TDF_SCEV. * tree-scalar-evolution.c: Likewise. * gcc.dg/tree-ssa/loop-17.c: Adjust. From-SVN: r175642 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bfd80811960..0a639958269 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2011-06-29 Richard Guenther + + * doc/invoke.texi: Document -scev dump modifier. + * tree-pass.h (TDF_SCEV): New dump flag. + * tree-dump.c (dump_option_value_in): Add scev. + * tree-chrec.c: Replace all TDF_DETAILS checks with TDF_SCEV. + * tree-scalar-evolution.c: Likewise. + 2011-06-29 Nathan Sidwell * config/arm/unwind-arm.c (enum __cxa_type_match_result): New. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index d397d607f1c..1fc40389f0a 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -5559,6 +5559,8 @@ Enable showing the unique ID (@code{DECL_UID}) for each variable. Enable showing the tree dump for each statement. @item eh Enable showing the EH region number holding each statement. +@item scev +Enable showing scalar evolution analysis details. @item all Turn on all options, except @option{raw}, @option{slim}, @option{verbose} and @option{lineno}. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0794930afce..6fefc387988 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-06-29 Richard Guenther + + * gcc.dg/tree-ssa/loop-17.c: Adjust. + 2011-06-29 Jason Merrill * g++.dg/cpp0x/initlist-value2.C: New. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c index d2903cef234..0e856d8d54f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c @@ -15,5 +15,5 @@ int foo (int *p) return i; } -/* { dg-final { scan-tree-dump "set_nb_iterations_in_loop = 1" "sccp" } } */ +/* { dg-final { scan-tree-dump "# of iterations 1, bounded by 1" "sccp" } } */ /* { dg-final { cleanup-tree-dump "sccp" } } */ diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 6d1dd22bbeb..f9bebee7fe6 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -587,7 +587,7 @@ chrec_apply (unsigned var, || chrec_contains_symbols_defined_in_loop (chrec, var)) return chrec_dont_know; - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) fprintf (dump_file, "(chrec_apply \n"); if (TREE_CODE (x) == INTEGER_CST && SCALAR_FLOAT_TYPE_P (type)) @@ -628,7 +628,7 @@ chrec_apply (unsigned var, break; } - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, " (varying_loop = %d\n", var); fprintf (dump_file, ")\n (chrec = "); diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c index 039aca16cc8..3e89cdf11f3 100644 --- a/gcc/tree-dump.c +++ b/gcc/tree-dump.c @@ -823,9 +823,10 @@ static const struct dump_option_value_info dump_options[] = {"alias", TDF_ALIAS}, {"nouid", TDF_NOUID}, {"enumerate_locals", TDF_ENUMERATE_LOCALS}, + {"scev", TDF_SCEV}, {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE - | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS)}, + | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV)}, {NULL, 0} }; diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index a17ef358142..2d277edb12b 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -83,6 +83,7 @@ enum tree_dump_index #define TDF_ALIAS (1 << 21) /* display alias information */ #define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */ #define TDF_CSELIB (1 << 23) /* Dump cselib details. */ +#define TDF_SCEV (1 << 24) /* Dump SCEV details. */ /* In tree-dump.c */ diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 1b68b36b30b..bfa8c93ae38 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -572,7 +572,7 @@ set_scalar_evolution (basic_block instantiated_below, tree scalar, tree chrec) if (dump_file) { - if (dump_flags & TDF_DETAILS) + if (dump_flags & TDF_SCEV) { fprintf (dump_file, "(set_scalar_evolution \n"); fprintf (dump_file, " instantiated_below = %d \n", @@ -600,7 +600,7 @@ get_scalar_evolution (basic_block instantiated_below, tree scalar) if (dump_file) { - if (dump_flags & TDF_DETAILS) + if (dump_flags & TDF_SCEV) { fprintf (dump_file, "(get_scalar_evolution \n"); fprintf (dump_file, " (scalar = "); @@ -628,7 +628,7 @@ get_scalar_evolution (basic_block instantiated_below, tree scalar) break; } - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, " (scalar_evolution = "); print_generic_expr (dump_file, res, 0); @@ -861,7 +861,7 @@ add_to_evolution (unsigned loop_nb, tree chrec_before, enum tree_code code, /* This should not happen. */ return chrec_dont_know; - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, "(add_to_evolution \n"); fprintf (dump_file, " (loop_nb = %d)\n", loop_nb); @@ -879,7 +879,7 @@ add_to_evolution (unsigned loop_nb, tree chrec_before, enum tree_code code, res = add_to_evolution_1 (loop_nb, chrec_before, to_add, at_stmt); - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, " (res = "); print_generic_expr (dump_file, res, 0); @@ -905,7 +905,7 @@ get_loop_exit_condition (const struct loop *loop) gimple res = NULL; edge exit_edge = single_exit (loop); - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) fprintf (dump_file, "(get_loop_exit_condition \n "); if (exit_edge) @@ -917,7 +917,7 @@ get_loop_exit_condition (const struct loop *loop) res = stmt; } - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { print_gimple_stmt (dump_file, res, 0, 0); fprintf (dump_file, ")\n"); @@ -1461,7 +1461,7 @@ analyze_evolution_in_loop (gimple loop_phi_node, struct loop *loop = loop_containing_stmt (loop_phi_node); basic_block bb; - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, "(analyze_evolution_in_loop \n"); fprintf (dump_file, " (loop_phi_node = "); @@ -1517,7 +1517,7 @@ analyze_evolution_in_loop (gimple loop_phi_node, evolution_function = chrec_merge (evolution_function, ev_fn); } - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, " (evolution_function = "); print_generic_expr (dump_file, evolution_function, 0); @@ -1541,7 +1541,7 @@ analyze_initial_condition (gimple loop_phi_node) tree init_cond = chrec_not_analyzed_yet; struct loop *loop = loop_containing_stmt (loop_phi_node); - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, "(analyze_initial_condition \n"); fprintf (dump_file, " (loop_phi_node = \n"); @@ -1593,7 +1593,7 @@ analyze_initial_condition (gimple loop_phi_node) init_cond = res; } - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, " (init_cond = "); print_generic_expr (dump_file, init_cond, 0); @@ -1942,7 +1942,7 @@ analyze_scalar_evolution (struct loop *loop, tree var) { tree res; - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, "(analyze_scalar_evolution \n"); fprintf (dump_file, " (loop_nb = %d)\n", loop->num); @@ -1954,7 +1954,7 @@ analyze_scalar_evolution (struct loop *loop, tree var) res = get_scalar_evolution (block_before_loop (loop), var); res = analyze_scalar_evolution_1 (loop, var, res); - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) fprintf (dump_file, ")\n"); return res; @@ -2700,7 +2700,7 @@ instantiate_scev (basic_block instantiate_below, struct loop *evolution_loop, tree res; htab_t cache = htab_create (10, hash_scev_info, eq_scev_info, del_scev_info); - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, "(instantiate_scev \n"); fprintf (dump_file, " (instantiate_below = %d)\n", instantiate_below->index); @@ -2713,7 +2713,7 @@ instantiate_scev (basic_block instantiate_below, struct loop *evolution_loop, res = instantiate_scev_r (instantiate_below, evolution_loop, chrec, false, cache, 0); - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, " (res = "); print_generic_expr (dump_file, res, 0); @@ -2779,7 +2779,7 @@ number_of_latch_executions (struct loop *loop) may_be_zero = NULL_TREE; - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) fprintf (dump_file, "(number_of_iterations_in_loop = \n"); res = chrec_dont_know; @@ -2804,7 +2804,7 @@ number_of_latch_executions (struct loop *loop) else res = chrec_dont_know; - if (dump_file && (dump_flags & TDF_DETAILS)) + if (dump_file && (dump_flags & TDF_SCEV)) { fprintf (dump_file, " (set_nb_iterations_in_loop = "); print_generic_expr (dump_file, res, 0);