Skip to content
Snippets Groups Projects
Commit 88618fa0 authored by Honza's avatar Honza
Browse files

Cleanup profile updating code in unrolling and splitting

I have noticed that for all these three cases I need same update of
loop exit probability.  While my earlier patch unified it for unrollers,
this patch makes it more general and also simplifies
tree-ssa-loop-split.cc.

I also refactored the code, since with all the special cases for
corrupted profile it gets relatively long.
I now also handle multiple loop exits in RTL unroller.

Bootstrapped/regtested x86_64-linux, comitted.
gcc/ChangeLog:

	* cfgloopmanip.cc (loop_count_in): Break out from ...
	(loop_exit_for_scaling): Break out from ...
	(update_loop_exit_probability_scale_dom_bbs): Break out from ...;
	add more sanity check and debug info.
	(scale_loop_profile): ... here.
	(create_empty_loop_on_edge): Fix whitespac.
	* cfgloopmanip.h (update_loop_exit_probability_scale_dom_bbs): Declare.
	* loop-unroll.cc (unroll_loop_constant_iterations): Use
	update_loop_exit_probability_scale_dom_bbs.
	* tree-ssa-loop-manip.cc (update_exit_probability_after_unrolling): Remove.
	(tree_transform_and_unroll_loop): Use
	update_loop_exit_probability_scale_dom_bbs.
	* tree-ssa-loop-split.cc (split_loop): Use
	update_loop_exit_probability_scale_dom_bbs.
parent fdbb0863
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment