diff options
author | Richard Biener <rguenther@suse.de> | 2021-05-06 11:29:25 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-05-06 13:54:02 +0200 |
commit | a1ac9ffb5a7f44b2e2633b7265c21ce803c8e854 (patch) | |
tree | 27b373b33d4efbf94f8f85d092ebf79c90a11b08 /gcc | |
parent | 1698f496c5ee96b980ba97f5cd5f56b633e4afe0 (diff) | |
download | gcc-a1ac9ffb5a7f44b2e2633b7265c21ce803c8e854.zip gcc-a1ac9ffb5a7f44b2e2633b7265c21ce803c8e854.tar.gz gcc-a1ac9ffb5a7f44b2e2633b7265c21ce803c8e854.tar.bz2 |
Avoid update_ssa quadraticness in loop splitting
We already take care to not apply loop splitting to IL produced
by splitting so we should be able to delay updating SSA and
loop-closed SSA that was left broken after loop versioning
until after we processed all opportunities.
2021-05-06 Richard Biener <rguenther@suse.de>
* tree-ssa-loop-split.c (split_loop): Delay updating SSA form.
Output an opt-info message.
(do_split_loop_on_cond): Likewise.
(tree_ssa_split_loops): Update SSA form here.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-ssa-loop-split.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gcc/tree-ssa-loop-split.c b/gcc/tree-ssa-loop-split.c index b80b6a7..3a09bbc 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; } @@ -1644,7 +1638,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; } |