This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Clenaup tree-ssa-sink after profile revamp
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 13 Nov 2017 18:59:48 +0100
- Subject: Clenaup tree-ssa-sink after profile revamp
- Authentication-results: sourceware.org; auth=none
Hi,
there is no need to compute frequencies here.
Bootstrapped/regtested x86-64-linux, comitted.
Honza
* tree-ssa-sink.c (select_best_block): Do not use frequencies.
Index: tree-ssa-sink.c
===================================================================
--- tree-ssa-sink.c (revision 254695)
+++ tree-ssa-sink.c (working copy)
@@ -226,8 +226,10 @@ select_best_block (basic_block early_bb,
/* If BEST_BB is at the same nesting level, then require it to have
significantly lower execution frequency to avoid gratutious movement. */
if (bb_loop_depth (best_bb) == bb_loop_depth (early_bb)
- && best_bb->count.to_frequency (cfun)
- < (early_bb->count.to_frequency (cfun) * threshold / 100.0))
+ /* If result of comparsion is unknown, preffer EARLY_BB.
+ Thus use !(...>=..) rather than (...<...) */
+ && !(best_bb->count.apply_scale (100, 1)
+ > (early_bb->count.apply_scale (threshold, 1))))
return best_bb;
/* No better block found, so return EARLY_BB, which happens to be the