From ab0e5308484abccb6c21d3a6593ab653a02784a2 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 22 Sep 2017 07:31:32 +0000 Subject: 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 * 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 --- gcc/sese.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gcc/sese.c') diff --git a/gcc/sese.c b/gcc/sese.c index 3279ead..4be7d34 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -335,9 +335,11 @@ get_false_edge_from_guard_bb (basic_block bb) /* Sets the false region of an IF_REGION to REGION. */ -void +static void if_region_set_false_region (ifsese if_region, sese_info_p region) { + free_dominance_info (CDI_DOMINATORS); + basic_block condition = if_region_get_condition_block (if_region); edge false_edge = get_false_edge_from_guard_bb (condition); basic_block dummy = false_edge->dest; @@ -348,6 +350,8 @@ if_region_set_false_region (ifsese if_region, sese_info_p region) hashval_t hash = htab_hash_pointer (exit_region); loop_exit **slot = current_loops->exits->find_slot_with_hash (exit_region, hash, NO_INSERT); + bool latch_p + = exit_region->dest->loop_father->latch == exit_region->src; entry_region->flags = false_edge->flags; false_edge->flags = exit_region->flags; @@ -359,7 +363,6 @@ if_region_set_false_region (ifsese if_region, sese_info_p region) delete_basic_block (dummy); exit_region->flags = EDGE_FALLTHRU; - recompute_all_dominators (); region->region.exit = false_edge; @@ -381,6 +384,10 @@ if_region_set_false_region (ifsese if_region, sese_info_p region) *slot = loop_exit; false_edge->src->loop_father->exits->next = loop_exit; } + if (latch_p) + exit_region->dest->loop_father->latch = before_region; + + calculate_dominance_info (CDI_DOMINATORS); } /* Creates an IFSESE with CONDITION on edge ENTRY. */ @@ -429,6 +436,7 @@ create_if_region_on_edge (edge entry, tree condition) ifsese move_sese_in_condition (sese_info_p region) { + gcc_assert (! dom_info_available_p (cfun, CDI_POST_DOMINATORS)); basic_block pred_block = split_edge (region->region.entry); ifsese if_region; -- cgit v1.1