diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
commit | e252b51ccde010cbd2a146485d8045103cd99533 (patch) | |
tree | e060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/tree-ssa-loop-split.c | |
parent | f10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff) | |
parent | 104c05c5284b7822d770ee51a7d91946c7e56d50 (diff) | |
download | gcc-e252b51ccde010cbd2a146485d8045103cd99533.zip gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2 |
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/tree-ssa-loop-split.c')
-rw-r--r-- | gcc/tree-ssa-loop-split.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/gcc/tree-ssa-loop-split.c b/gcc/tree-ssa-loop-split.c index b80b6a7..3f6ad04 100644 --- a/gcc/tree-ssa-loop-split.c +++ b/gcc/tree-ssa-loop-split.c @@ -589,7 +589,6 @@ split_loop (class loop *loop1) profile_probability::always (), true); gcc_assert (loop2); - update_ssa (TODO_update_ssa); edge new_e = connect_loops (loop1, loop2); connect_loop_phis (loop1, loop2, new_e); @@ -621,14 +620,13 @@ split_loop (class loop *loop1) free_original_copy_tables (); - /* We destroyed LCSSA form above. Eventually we might be able - to fix it on the fly, for now simply punt and use the helper. */ - rewrite_into_loop_closed_ssa_1 (NULL, 0, SSA_OP_USE, loop1); - changed = true; if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, ";; Loop split.\n"); + if (dump_enabled_p ()) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, guard_stmt, "loop split\n"); + /* Only deal with the first opportunity. */ break; } @@ -1532,8 +1530,6 @@ do_split_loop_on_cond (struct loop *loop1, edge invar_branch) to_loop1->flags |= true_invar ? EDGE_FALSE_VALUE : EDGE_TRUE_VALUE; to_loop2->flags |= true_invar ? EDGE_TRUE_VALUE : EDGE_FALSE_VALUE; - update_ssa (TODO_update_ssa); - /* Due to introduction of a control flow edge from loop1 latch to loop2 pre-header, we should update PHIs in loop2 to reflect this connection between loop1 and loop2. */ @@ -1541,8 +1537,6 @@ do_split_loop_on_cond (struct loop *loop1, edge invar_branch) free_original_copy_tables (); - rewrite_into_loop_closed_ssa_1 (NULL, 0, SSA_OP_USE, loop1); - return true; } @@ -1604,18 +1598,17 @@ split_loop_on_cond (struct loop *loop) static unsigned int tree_ssa_split_loops (void) { - class loop *loop; bool changed = false; gcc_assert (scev_initialized_p ()); calculate_dominance_info (CDI_POST_DOMINATORS); - FOR_EACH_LOOP (loop, LI_INCLUDE_ROOT) + for (auto loop : loops_list (cfun, LI_INCLUDE_ROOT)) loop->aux = NULL; /* Go through all loops starting from innermost. */ - FOR_EACH_LOOP (loop, LI_FROM_INNERMOST) + for (auto loop : loops_list (cfun, LI_FROM_INNERMOST)) { if (loop->aux) { @@ -1636,7 +1629,7 @@ tree_ssa_split_loops (void) } } - FOR_EACH_LOOP (loop, LI_INCLUDE_ROOT) + for (auto loop : loops_list (cfun, LI_INCLUDE_ROOT)) loop->aux = NULL; clear_aux_for_blocks (); @@ -1644,7 +1637,10 @@ tree_ssa_split_loops (void) free_dominance_info (CDI_POST_DOMINATORS); if (changed) - return TODO_cleanup_cfg; + { + rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa); + return TODO_cleanup_cfg; + } return 0; } |