aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgloopmanip.h
diff options
context:
space:
mode:
authorHonza <jh@ryzen4.suse.cz>2023-07-28 19:39:19 +0200
committerHonza <jh@ryzen4.suse.cz>2023-07-28 19:39:19 +0200
commit88618fa0211d77d91b70f7af9b02e08a34b57912 (patch)
treecfd1053672c124cdf0613e618201b8f1a3f65280 /gcc/cfgloopmanip.h
parentfdbb0863b6111ad3f45b79f47ebfe471555b2c4a (diff)
downloadgcc-88618fa0211d77d91b70f7af9b02e08a34b57912.zip
gcc-88618fa0211d77d91b70f7af9b02e08a34b57912.tar.gz
gcc-88618fa0211d77d91b70f7af9b02e08a34b57912.tar.bz2
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.
Diffstat (limited to 'gcc/cfgloopmanip.h')
-rw-r--r--gcc/cfgloopmanip.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cfgloopmanip.h b/gcc/cfgloopmanip.h
index dab7b31..2dda504 100644
--- a/gcc/cfgloopmanip.h
+++ b/gcc/cfgloopmanip.h
@@ -68,6 +68,9 @@ class loop * loop_version (class loop *, void *,
void adjust_loop_info_after_peeling (class loop *loop, int npeel, bool precise);
void scale_dominated_blocks_in_loop (class loop *loop, basic_block bb,
profile_count num, profile_count den);
+edge update_loop_exit_probability_scale_dom_bbs
+ (class loop *loop, edge exit_edge = NULL,
+ profile_count desired_count = profile_count::uninitialized ());
void update_exit_probability_after_unrolling (class loop *loop, edge new_exit);
#endif /* GCC_CFGLOOPMANIP_H */