This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[autovect] debugging dumps cleanup
- From: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Feb 2005 16:31:35 +0100
- Subject: [autovect] debugging dumps cleanup
Bootstrapped and tested on i686, installed on autovect branch.
Index: ChangeLog.autovect
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ChangeLog.autovect,v
retrieving revision 1.1.2.31
diff -d -u -p -r1.1.2.31 ChangeLog.autovect
--- ChangeLog.autovect 2 Feb 2005 22:23:43 -0000 1.1.2.31
+++ ChangeLog.autovect 14 Feb 2005 15:26:30 -0000
@@ -1,3 +1,23 @@
+2005-02-14 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-data-ref.c (subscript_dependence_tester): Count only once
+ dependent relations instead of incrementing num_dependence_dependent
+ for each subscript.
+ * tree-scalar-evolution.c (add_to_evolution): Don't handle REAL_CST.
+ (number_of_iterations_for_all_loops): Count the number of loops for
+ which there is an estimation of the number of iterations.
+ (number_of_iterations_for_all_loops): Print nb_estimated_loops.
+ (chrec_stats): Add nb_other.
+ (reset_chrecs_counters): Initialize to zero nb_other.
+ (dump_chrecs_stats): Dump nb_other, the number of compound
+ expressions.
+ (gather_chrec_stats): Count the number of undetermined chrecs before
+ the classification. On the default case, increment nb_other.
+ (analyze_scalar_evolution_for_all_loop_phi_nodes): Avoid iterating
+ over the loop phis, because some of them could be removed
+ during the analysis. Record the phi nodes that have to be analyzed
+ in a vector of trees.
+
2005-02-02 Keith Besaw <kbesaw@us.ibm.com>
* tree-vectorizer.c (vectorizable_load): Remove call to
Index: tree-data-ref.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.c,v
retrieving revision 2.15.4.9
diff -d -u -p -r2.15.4.9 tree-data-ref.c
--- tree-data-ref.c 31 Jan 2005 16:01:44 -0000 2.15.4.9
+++ tree-data-ref.c 14 Feb 2005 15:26:31 -0000
@@ -2016,7 +2016,7 @@ subscript_dependence_tester (struct data
{
finalize_ddr_dependent (ddr, chrec_dont_know);
dependence_stats.num_dependence_undetermined++;
- break;
+ goto subs_test_end;
}
else if (overlaps_a == chrec_known
@@ -2024,7 +2024,7 @@ subscript_dependence_tester (struct data
{
finalize_ddr_dependent (ddr, chrec_known);
dependence_stats.num_dependence_independent++;
- break;
+ goto subs_test_end;
}
else
@@ -2032,10 +2032,12 @@ subscript_dependence_tester (struct data
SUB_CONFLICTS_IN_A (subscript) = overlaps_a;
SUB_CONFLICTS_IN_B (subscript) = overlaps_b;
SUB_LAST_CONFLICT (subscript) = last_conflicts;
- dependence_stats.num_dependence_dependent++;
}
}
-
+
+ dependence_stats.num_dependence_dependent++;
+
+ subs_test_end:;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, ")\n");
}
Index: tree-scalar-evolution.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-scalar-evolution.c,v
retrieving revision 2.10.2.4
diff -d -u -p -r2.10.2.4 tree-scalar-evolution.c
--- tree-scalar-evolution.c 31 Jan 2005 11:03:25 -0000 2.10.2.4
+++ tree-scalar-evolution.c 14 Feb 2005 15:26:31 -0000
@@ -879,8 +879,8 @@ add_to_evolution (unsigned loop_nb,
/* TO_ADD is either a scalar, or a parameter. TO_ADD is not
instantiated at this point. */
- if (TREE_CODE (to_add) == POLYNOMIAL_CHREC)
- /* This should not happen. */
+ if (TREE_CODE (to_add) == POLYNOMIAL_CHREC
+ || TREE_CODE (to_add) == REAL_CST)
return chrec_dont_know;
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2336,13 +2336,20 @@ number_of_iterations_for_all_loops (varr
unsigned int i;
unsigned nb_chrec_dont_know_loops = 0;
unsigned nb_static_loops = 0;
+ unsigned nb_estimated_loops = 0;
for (i = 0; i < VARRAY_ACTIVE_SIZE (exit_conditions); i++)
{
- tree res = number_of_iterations_in_loop
- (loop_containing_stmt (VARRAY_TREE (exit_conditions, i)));
+ struct loop *loop = loop_containing_stmt (VARRAY_TREE (exit_conditions,
+ i));
+ tree res = number_of_iterations_in_loop (loop);
if (chrec_contains_undetermined (res))
- nb_chrec_dont_know_loops++;
+ {
+ if (loop->estimated_nb_iterations)
+ nb_estimated_loops++;
+ else
+ nb_chrec_dont_know_loops++;
+ }
else
nb_static_loops++;
}
@@ -2353,6 +2360,7 @@ number_of_iterations_for_all_loops (varr
fprintf (dump_file, "-----------------------------------------\n");
fprintf (dump_file, "%d\tnb_chrec_dont_know_loops\n", nb_chrec_dont_know_loops);
fprintf (dump_file, "%d\tnb_static_loops\n", nb_static_loops);
+ fprintf (dump_file, "%d\tnb_estimated_loops\n", nb_estimated_loops);
fprintf (dump_file, "%d\tnb_total_loops\n", current_loops->num);
fprintf (dump_file, "-----------------------------------------\n");
fprintf (dump_file, ")\n\n");
@@ -2373,6 +2381,7 @@ struct chrec_stats
unsigned nb_higher_poly;
unsigned nb_chrec_dont_know;
unsigned nb_undetermined;
+ unsigned nb_other;
};
/* Reset the counters. */
@@ -2386,6 +2395,7 @@ reset_chrecs_counters (struct chrec_stat
stats->nb_higher_poly = 0;
stats->nb_chrec_dont_know = 0;
stats->nb_undetermined = 0;
+ stats->nb_other = 0;
}
/* Dump the contents of a CHREC_STATS structure. */
@@ -2404,6 +2414,8 @@ dump_chrecs_stats (FILE *file, struct ch
fprintf (file, "%d\ttotal chrecs\n", stats->nb_chrecs);
fprintf (file, "%d\twith undetermined coefficients\n",
stats->nb_undetermined);
+ fprintf (file, "%d\tother compound expressions\n",
+ stats->nb_other);
fprintf (file, "-----------------------------------------\n");
fprintf (file, "%d\tchrecs in the scev database\n",
(int) htab_elements (scalar_evolution_info));
@@ -2427,8 +2439,10 @@ gather_chrec_stats (tree chrec, struct c
stats->nb_chrecs++;
- if (chrec == NULL_TREE)
+ if (chrec_contains_undetermined (chrec))
{
+ if (dump_file && (dump_flags & TDF_STATS))
+ fprintf (dump_file, " undetermined\n");
stats->nb_undetermined++;
return;
}
@@ -2458,16 +2472,12 @@ gather_chrec_stats (tree chrec, struct c
break;
default:
- break;
- }
-
- if (chrec_contains_undetermined (chrec))
- {
if (dump_file && (dump_flags & TDF_STATS))
- fprintf (dump_file, " undetermined\n");
- stats->nb_undetermined++;
+ fprintf (dump_file, " other expression\n");
+ stats->nb_other++;
+ break;
}
-
+
if (dump_file && (dump_flags & TDF_STATS))
fprintf (dump_file, ")\n");
}
@@ -2495,20 +2505,34 @@ analyze_scalar_evolution_for_all_loop_ph
struct loop *loop;
basic_block bb;
tree phi, chrec;
+ VEC (tree) *loop_phis;
+ int j;
loop = loop_containing_stmt (VARRAY_TREE (exit_conditions, i));
bb = loop->header;
-
+
+ loop_phis = VEC_alloc (tree, 2);
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- if (is_gimple_reg (PHI_RESULT (phi)))
- {
- chrec = instantiate_parameters
- (loop,
- analyze_scalar_evolution (loop, PHI_RESULT (phi)));
+ {
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi)))
+ continue;
+
+ VEC_safe_push (tree, loop_phis, phi);
+ }
+
+ for (j = 0; VEC_iterate (tree, loop_phis, j, phi); j++)
+ {
+ if (is_gimple_reg (PHI_RESULT (phi)))
+ {
+ chrec = instantiate_parameters
+ (loop,
+ analyze_scalar_evolution (loop, PHI_RESULT (phi)));
- if (dump_file && (dump_flags & TDF_STATS))
- gather_chrec_stats (chrec, &stats);
- }
+ if (dump_file && (dump_flags & TDF_STATS))
+ gather_chrec_stats (chrec, &stats);
+ }
+ }
+ VEC_free (tree, loop_phis);
}
if (dump_file && (dump_flags & TDF_STATS))