diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-31 12:52:07 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-31 12:52:07 +0000 |
commit | f29b326e63ac389a41948b052128a3f5dec1e4df (patch) | |
tree | ec47e89df6f23c1dc88cad878c8a9f76d8738fa1 /gcc/predict.c | |
parent | 21e3f8b28120aaff2d879a1a779aeae1c832b6f4 (diff) | |
download | gcc-f29b326e63ac389a41948b052128a3f5dec1e4df.tar.gz |
* postreload-gcse.c (eliminate_partially_redundant_loads): Use optimize_bb_for_size_p.
* predict.c (maybe_hot_frequency_p): Make inline.
(maybe_hot_count_p): Break out from ...
(maybe_hot_bb_p): ... this one.
(maybe_hot_edge_p): Simplify.
* basic-block.h (probably_cold_bb_p): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139830 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/gcc/predict.c b/gcc/predict.c index e02f9f890c2..183ae8fa7cb 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -110,7 +110,8 @@ static const struct predictor_info predictor_info[]= { #undef DEF_PREDICTOR /* Return TRUE if frequency FREQ is considered to be hot. */ -static bool + +static inline bool maybe_hot_frequency_p (int freq) { if (!profile_info || !flag_branch_probabilities) @@ -127,17 +128,27 @@ maybe_hot_frequency_p (int freq) return true; } +/* Return TRUE if frequency FREQ is considered to be hot. */ + +static inline bool +maybe_hot_count_p (gcov_type count) +{ + if (profile_status != PROFILE_READ) + return true; + /* Code executed at most once is not hot. */ + if (profile_info->runs >= count) + return false; + return (count + > profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION)); +} + /* Return true in case BB can be CPU intensive and should be optimized for maximal performance. */ bool maybe_hot_bb_p (const_basic_block bb) { - if (profile_info && flag_branch_probabilities - && (bb->count - < profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION))) - return false; - return maybe_hot_frequency_p (bb->frequency); + return maybe_hot_count_p (bb->count) || maybe_hot_frequency_p (bb->frequency); } /* Return true if the call can be hot. */ @@ -167,28 +178,7 @@ cgraph_maybe_hot_edge_p (struct cgraph_edge *edge) bool maybe_hot_edge_p (edge e) { - if (profile_info && flag_branch_probabilities - && (e->count - < profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION))) - return false; - return maybe_hot_frequency_p (EDGE_FREQUENCY (e)); -} - -/* Return true in case BB is cold and should be optimized for size. */ - -bool -probably_cold_bb_p (const_basic_block bb) -{ - if (profile_info && flag_branch_probabilities - && (bb->count - < profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION))) - return true; - if ((!profile_info || !flag_branch_probabilities) - && cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED) - return true; - if (bb->frequency < BB_FREQ_MAX / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)) - return true; - return false; + return maybe_hot_count_p (e->count) || maybe_hot_frequency_p (EDGE_FREQUENCY (e)); } /* Return true in case BB is probably never executed. */ |