aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-11-10 19:10:51 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-11-10 18:10:51 +0000
commitd07f74faa60a3604b14e1ad7c25ac983731f0394 (patch)
tree74341a584cf3a0993cf76bdbd761394bdc84523a /gcc/cgraph.c
parentd40e2362bb6dcff1ec3905cd8db1ad7e5ee4a1dd (diff)
downloadgcc-d07f74faa60a3604b14e1ad7c25ac983731f0394.zip
gcc-d07f74faa60a3604b14e1ad7c25ac983731f0394.tar.gz
gcc-d07f74faa60a3604b14e1ad7c25ac983731f0394.tar.bz2
* cgraph.c (cgraph_edge::maybe_hot_p): Do not use sreal_frequency.
From-SVN: r278021
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 96f1261..aa54e95 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2697,14 +2697,18 @@ cgraph_edge::maybe_hot_p (void)
return false;
if (caller->frequency == NODE_FREQUENCY_HOT)
return true;
- /* If profile is now known yet, be conservative.
- FIXME: this predicate is used by early inliner and can do better there. */
- if (symtab->state < IPA_SSA)
+ if (!count.initialized_p ())
return true;
- if (caller->frequency == NODE_FREQUENCY_EXECUTED_ONCE
- && sreal_frequency () * 2 < 3)
+ cgraph_node *where = caller->inlined_to ? caller->inlined_to : caller;
+ if (!where->count.initialized_p ())
return false;
- if (sreal_frequency () * PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION) <= 1)
+ if (caller->frequency == NODE_FREQUENCY_EXECUTED_ONCE)
+ {
+ if (count.apply_scale (2, 1) < where->count.apply_scale (3, 1))
+ return false;
+ }
+ else if (count.apply_scale (PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION), 1)
+ < where->count)
return false;
return true;
}