+2017-10-20 Richard Biener <rguenther@suse.de>
+
+ * graphite-isl-ast-to-gimple.c
+ (translate_isl_ast_to_gimple::graphite_copy_stmts_from_block):
+ Remove return value and simplify, dump copied stmt after lhs
+ adjustment.
+ (translate_isl_ast_to_gimple::translate_isl_ast_node_user):
+ Reduce dump verbosity.
+ (gsi_insert_earliest): Likewise.
+ (translate_isl_ast_to_gimple::copy_bb_and_scalar_dependences): Adjust.
+ * graphite.c (print_global_statistics): Adjust dumping.
+ (print_graphite_scop_statistics): Likewise.
+ (print_graphite_statistics): Do not dump loops here.
+ (graphite_transform_loops): But here.
+
2017-10-20 Nicolas Roche <roche@adacore.com>
* configure.ac (ACX_PROG_GNAT): Append "libgnat" to the include dir.
tree get_rename_from_scev (tree old_name, gimple_seq *stmts, loop_p loop,
vec<tree> iv_map);
- bool graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
+ void graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
vec<tree> iv_map);
edge copy_bb_and_scalar_dependences (basic_block bb, edge next_e,
vec<tree> iv_map);
isl_ast_expr_free (user_expr);
basic_block old_bb = GBB_BB (gbb);
- if (dump_file)
+ if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file,
"[codegen] copying from bb_%d on edge (bb_%d, bb_%d)\n",
old_bb->index, next_e->src->index, next_e->dest->index);
print_loops_bb (dump_file, GBB_BB (gbb), 0, 3);
-
}
next_e = copy_bb_and_scalar_dependences (old_bb, next_e, iv_map);
if (codegen_error_p ())
return NULL;
- if (dump_file)
+ if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "[codegen] (after copy) new basic block\n");
print_loops_bb (dump_file, next_e->src, 0, 3);
if (dump_file)
{
- fprintf (dump_file, "[codegen] inserting statement: ");
+ fprintf (dump_file, "[codegen] inserting statement in BB %d: ",
+ gimple_bb (use_stmt)->index);
print_gimple_stmt (dump_file, use_stmt, 0, TDF_VOPS | TDF_MEMSYMS);
- print_loops_bb (dump_file, gimple_bb (use_stmt), 0, 3);
}
}
}
/* Duplicates the statements of basic block BB into basic block NEW_BB
and compute the new induction variables according to the IV_MAP. */
-bool translate_isl_ast_to_gimple::
+void translate_isl_ast_to_gimple::
graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
vec<tree> iv_map)
{
/* Create a new copy of STMT and duplicate STMT's virtual
operands. */
gimple *copy = gimple_copy (stmt);
- gsi_insert_after (&gsi_tgt, copy, GSI_NEW_STMT);
/* Rather than not copying debug stmts we reset them.
??? Where we can rewrite uses without inserting new
gcc_unreachable ();
}
- if (dump_file)
- {
- fprintf (dump_file, "[codegen] inserting statement: ");
- print_gimple_stmt (dump_file, copy, 0);
- }
-
maybe_duplicate_eh_stmt (copy, stmt);
gimple_duplicate_stmt_histograms (cfun, copy, cfun, stmt);
create_new_def_for (old_name, copy, def_p);
}
- if (codegen_error_p ())
- return false;
+ gsi_insert_after (&gsi_tgt, copy, GSI_NEW_STMT);
+ if (dump_file)
+ {
+ fprintf (dump_file, "[codegen] inserting statement: ");
+ print_gimple_stmt (dump_file, copy, 0);
+ }
/* For each SCEV analyzable SSA_NAME, rename their usage. */
ssa_op_iter iter;
update_stmt (copy);
}
-
- return true;
}
gsi_insert_after (&gsi_tgt, ass, GSI_NEW_STMT);
}
- if (!graphite_copy_stmts_from_block (bb, new_bb, iv_map))
- {
- set_codegen_error ();
- return NULL;
- }
+ graphite_copy_stmts_from_block (bb, new_bb, iv_map);
/* Insert out-of SSA copies on the original BB outgoing edges. */
gsi_tgt = gsi_last_bb (new_bb);
fprintf (file, "LOOPS:%ld, ", n_loops);
fprintf (file, "CONDITIONS:%ld, ", n_conditions);
fprintf (file, "STMTS:%ld)\n", n_stmts);
- fprintf (file, "\nGlobal profiling statistics (");
+ fprintf (file, "Global profiling statistics (");
fprintf (file, "BBS:");
n_p_bbs.dump (file);
fprintf (file, ", LOOPS:");
n_p_conditions.dump (file);
fprintf (file, ", STMTS:");
n_p_stmts.dump (file);
- fprintf (file, ")\n");
+ fprintf (file, ")\n\n");
}
/* Print statistics for SCOP to FILE. */
fprintf (file, "LOOPS:%ld, ", n_loops);
fprintf (file, "CONDITIONS:%ld, ", n_conditions);
fprintf (file, "STMTS:%ld)\n", n_stmts);
- fprintf (file, "\nSCoP profiling statistics (");
+ fprintf (file, "SCoP profiling statistics (");
fprintf (file, "BBS:");
n_p_bbs.dump (file);
fprintf (file, ", LOOPS:");
n_p_conditions.dump (file);
fprintf (file, ", STMTS:");
n_p_stmts.dump (file);
- fprintf (file, ")\n");
+ fprintf (file, ")\n\n");
}
/* Print statistics for SCOPS to FILE. */
print_graphite_statistics (FILE* file, vec<scop_p> scops)
{
int i;
-
scop_p scop;
FOR_EACH_VEC_ELT (scops, i, scop)
print_graphite_scop_statistics (file, scop);
-
- /* Print the loop structure. */
- print_loops (file, 2);
- print_loops (file, 3);
}
/* Deletes all scops in SCOPS. */
sort_sibling_loops (cfun);
canonicalize_loop_closed_ssa_form ();
+ /* Print the loop structure. */
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ print_loops (dump_file, 2);
+ print_loops (dump_file, 3);
+ }
+
calculate_dominance_info (CDI_POST_DOMINATORS);
build_scops (&scops);
free_dominance_info (CDI_POST_DOMINATORS);