diff options
author | Richard Biener <rguenther@suse.de> | 2017-09-22 07:31:32 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-09-22 07:31:32 +0000 |
commit | ab0e5308484abccb6c21d3a6593ab653a02784a2 (patch) | |
tree | 021bf36f1ccc132d37c48e39b7cde0e5b57beba2 /gcc/graphite-isl-ast-to-gimple.c | |
parent | e7ba6a6041df85d7027a4e776f144a2f21204fdf (diff) | |
download | gcc-ab0e5308484abccb6c21d3a6593ab653a02784a2.zip gcc-ab0e5308484abccb6c21d3a6593ab653a02784a2.tar.gz gcc-ab0e5308484abccb6c21d3a6593ab653a02784a2.tar.bz2 |
graphite-isl-ast-to-gimple.c (translate_pending_phi_nodes): Verify both BBs contain loop PHI nodes before dispatching to copy_loop_phi_args.
2017-09-21 Richard Biener <rguenther@suse.de>
* graphite-isl-ast-to-gimple.c (translate_pending_phi_nodes):
Verify both BBs contain loop PHI nodes before dispatching to
copy_loop_phi_args.
(graphite_regenerate_ast_isl): Do not recompute dominators,
do not verify three times. Restructure for clarity.
* graphite-scop-detection.c (same_close_phi_node,
remove_duplicate_close_phi, make_close_phi_nodes_unique,
defined_in_loop_p, canonicalize_loop_closed_ssa,
canonicalize_loop_closed_ssa_form): Simplify, remove excess
checking and SSA rewrite, move to ...
* graphite.c: ... here. Include ssa.h and tree-ssa-loop-manip.h.
(graphite_initialize): Do not pass in ctx, do not reset the
SCEV cache, compute only dominators.
(graphite_transform_loops): Allocate ISL ctx after
graphite_initialize. Call canonicalize_loop_closed_ssa_form.
Maintain post-dominators only around build_scops.
* sese.c (if_region_set_false_region): Make static. Free
and recompute dominators.
(move_sese_in_condition): Assert we don't get called with
post-dominators computed.
* sese.h (if_region_set_false_region): Remove.
From-SVN: r253090
Diffstat (limited to 'gcc/graphite-isl-ast-to-gimple.c')
-rw-r--r-- | gcc/graphite-isl-ast-to-gimple.c | 57 |
1 files changed, 20 insertions, 37 deletions
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index 87a1b06..1fb1bbd 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -2759,7 +2759,8 @@ translate_pending_phi_nodes () } auto_vec <tree, 1> iv_map; - if (bb_contains_loop_phi_nodes (new_bb)) + if (bb_contains_loop_phi_nodes (new_bb) + && bb_contains_loop_phi_nodes (old_bb)) codegen_error = !copy_loop_phi_args (old_phi, ibp_old_bb, new_phi, ibp_new_bb, false); else if (bb_contains_loop_close_phi_nodes (new_bb)) @@ -2941,12 +2942,8 @@ graphite_regenerate_ast_isl (scop_p scop) print_isl_ast (dump_file, root_node); } - recompute_all_dominators (); - graphite_verify (); - if_region = move_sese_in_condition (region); region->if_region = if_region; - recompute_all_dominators (); loop_p context_loop = region->region.entry->src->loop_father; @@ -2960,45 +2957,28 @@ graphite_regenerate_ast_isl (scop_p scop) region->if_region->true_region->region.exit = single_succ_edge (bb); t.translate_isl_ast (context_loop, root_node, e, ip); + if (! t.codegen_error_p ()) + t.translate_pending_phi_nodes (); + if (! t.codegen_error_p ()) + { + sese_insert_phis_for_liveouts (region, + if_region->region->region.exit->src, + if_region->false_region->region.exit, + if_region->true_region->region.exit); + if (dump_file) + fprintf (dump_file, "[codegen] isl AST to Gimple succeeded.\n"); + + mark_virtual_operands_for_renaming (cfun); + update_ssa (TODO_update_ssa); + } + if (t.codegen_error_p ()) { if (dump_file) fprintf (dump_file, "codegen error: " "reverting back to the original code.\n"); set_ifsese_condition (if_region, integer_zero_node); - } - else - { - t.translate_pending_phi_nodes (); - if (!t.codegen_error_p ()) - { - sese_insert_phis_for_liveouts (region, - if_region->region->region.exit->src, - if_region->false_region->region.exit, - if_region->true_region->region.exit); - mark_virtual_operands_for_renaming (cfun); - update_ssa (TODO_update_ssa); - - - graphite_verify (); - scev_reset (); - recompute_all_dominators (); - graphite_verify (); - if (dump_file) - fprintf (dump_file, "[codegen] isl AST to Gimple succeeded.\n"); - } - else - { - if (dump_file) - fprintf (dump_file, "[codegen] unsuccessful in translating" - " pending phis, reverting back to the original code.\n"); - set_ifsese_condition (if_region, integer_zero_node); - } - } - - if (t.codegen_error_p ()) - { /* We registered new names, scrap that. */ if (need_ssa_update_p (cfun)) delete_update_ssa (); @@ -3017,6 +2997,9 @@ graphite_regenerate_ast_isl (scop_p scop) delete_loop (loop); } + graphite_verify (); + scev_reset (); + free (if_region->true_region); free (if_region->region); free (if_region); |