refactor LIM a bit
authorRichard Biener <rguenther@suse.de>
Wed, 5 Aug 2020 10:04:59 +0000 (12:04 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 5 Aug 2020 11:59:07 +0000 (13:59 +0200)
commit6aec53ee4f75a64cc9c35577e8d785ba2b692270
tree59dc5dd2484cbbf2e0eaedacc1167d03e2304e59
parentf0699540f37e2550974f9049778a42a634062c0b
refactor LIM a bit

This refactors LIM to eschew alloc_aux_for_edges and re-uses the RPO
order of the move_computations walk for invariantness computation as well.
It also removes one unnecessary sorting (but retaining it as checking
code because we bsearch the vector) and moves edge insert commit code
to the place where it doesn't have to scan all the functions edges.

This was all done when investigating whether LIM can be refactored
to work on a specific loop for on-demand processing (but we're not
there yet).

2020-08-05  Richard Biener  <rguenther@suse.de>

* tree-ssa-loop-im.c (invariantness_dom_walker): Remove.
(invariantness_dom_walker::before_dom_children): Move to ...
(compute_invariantness): ... this function.
(move_computations): Inline ...
(tree_ssa_lim): ... here, share RPO order and avoid some
cfun references.
(analyze_memory_references): Remove sorting of location
lists, instead assert they are sorted already when checking.
(prev_flag_edges): Remove.
(execute_sm_if_changed): Pass down and adjust prev edge state.
(execute_sm_exit): Likewise.
(hoist_memory_references): Likewise.  Commit edge insertions
of each processed exit.
(store_motion_loop): Do not commit edge insertions on all
edges in the function.
(tree_ssa_lim_initialize): Do not call alloc_aux_for_edges.
(tree_ssa_lim_finalize): Do not call free_aux_for_edges.
gcc/tree-ssa-loop-im.c