Commit 269ba950 by Richard Biener Committed by Richard Biener

tree-vect-loop.c (vect_compute_single_scalar_iteration_cost): Open a dump scope.

2018-10-08  Richard Biener  <rguenther@suse.de>

	* tree-vect-loop.c (vect_compute_single_scalar_iteration_cost):
	Open a dump scope.
	* tree-vectorizer.c (dump_stmt_cost): Add cost param and dump it.
	* tree-vectorizer.h (dump_stmt_cost): Adjust.
	(add_stmt_cost): Dump return value of the hook.

From-SVN: r264923
parent aca0dcde
2018-10-08 Richard Biener <rguenther@suse.de> 2018-10-08 Richard Biener <rguenther@suse.de>
* tree-vect-loop.c (vect_compute_single_scalar_iteration_cost):
Open a dump scope.
* tree-vectorizer.c (dump_stmt_cost): Add cost param and dump it.
* tree-vectorizer.h (dump_stmt_cost): Adjust.
(add_stmt_cost): Dump return value of the hook.
2018-10-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/63155 PR tree-optimization/63155
* tree-ssa-propagate.c (add_ssa_edge): Do cheap check first. * tree-ssa-propagate.c (add_ssa_edge): Do cheap check first.
(ssa_propagation_engine::ssa_propagate): Remove redundant (ssa_propagation_engine::ssa_propagate): Remove redundant
...@@ -1072,6 +1072,8 @@ vect_compute_single_scalar_iteration_cost (loop_vec_info loop_vinfo) ...@@ -1072,6 +1072,8 @@ vect_compute_single_scalar_iteration_cost (loop_vec_info loop_vinfo)
int nbbs = loop->num_nodes, factor; int nbbs = loop->num_nodes, factor;
int innerloop_iters, i; int innerloop_iters, i;
DUMP_VECT_SCOPE ("vect_compute_single_scalar_iteration_cost");
/* Gather costs for statements in the scalar loop. */ /* Gather costs for statements in the scalar loop. */
/* FORNOW. */ /* FORNOW. */
......
...@@ -89,7 +89,7 @@ dump_user_location_t vect_location; ...@@ -89,7 +89,7 @@ dump_user_location_t vect_location;
void void
dump_stmt_cost (FILE *f, void *data, int count, enum vect_cost_for_stmt kind, dump_stmt_cost (FILE *f, void *data, int count, enum vect_cost_for_stmt kind,
stmt_vec_info stmt_info, int misalign, stmt_vec_info stmt_info, int misalign, unsigned cost,
enum vect_cost_model_location where) enum vect_cost_model_location where)
{ {
fprintf (f, "%p ", data); fprintf (f, "%p ", data);
...@@ -159,6 +159,7 @@ dump_stmt_cost (FILE *f, void *data, int count, enum vect_cost_for_stmt kind, ...@@ -159,6 +159,7 @@ dump_stmt_cost (FILE *f, void *data, int count, enum vect_cost_for_stmt kind,
fprintf (f, "%s ", ks); fprintf (f, "%s ", ks);
if (kind == unaligned_load || kind == unaligned_store) if (kind == unaligned_load || kind == unaligned_store)
fprintf (f, "(misalign %d) ", misalign); fprintf (f, "(misalign %d) ", misalign);
fprintf (f, "costs %u ", cost);
const char *ws = "unknown"; const char *ws = "unknown";
switch (where) switch (where)
{ {
......
...@@ -1199,7 +1199,8 @@ init_cost (struct loop *loop_info) ...@@ -1199,7 +1199,8 @@ init_cost (struct loop *loop_info)
} }
extern void dump_stmt_cost (FILE *, void *, int, enum vect_cost_for_stmt, extern void dump_stmt_cost (FILE *, void *, int, enum vect_cost_for_stmt,
stmt_vec_info, int, enum vect_cost_model_location); stmt_vec_info, int, unsigned,
enum vect_cost_model_location);
/* Alias targetm.vectorize.add_stmt_cost. */ /* Alias targetm.vectorize.add_stmt_cost. */
...@@ -1208,10 +1209,12 @@ add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind, ...@@ -1208,10 +1209,12 @@ add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind,
stmt_vec_info stmt_info, int misalign, stmt_vec_info stmt_info, int misalign,
enum vect_cost_model_location where) enum vect_cost_model_location where)
{ {
unsigned cost = targetm.vectorize.add_stmt_cost (data, count, kind,
stmt_info, misalign, where);
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
dump_stmt_cost (dump_file, data, count, kind, stmt_info, misalign, where); dump_stmt_cost (dump_file, data, count, kind, stmt_info, misalign,
return targetm.vectorize.add_stmt_cost (data, count, kind, cost, where);
stmt_info, misalign, where); return cost;
} }
/* Alias targetm.vectorize.finish_cost. */ /* Alias targetm.vectorize.finish_cost. */
......
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