diff options
author | Jan Hubicka <jh@suse.cz> | 2008-12-06 09:34:20 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2008-12-06 08:34:20 +0000 |
commit | c0ee00211f683cd8a0974cb211822c50b35b6782 (patch) | |
tree | 1c3592ee7c56ccfdd8c2ce7168b872880b33ba1d /gcc/cgraphbuild.c | |
parent | abc79c3a6d295d42b0a9ab48cea07090b0161ee8 (diff) | |
download | gcc-c0ee00211f683cd8a0974cb211822c50b35b6782.zip gcc-c0ee00211f683cd8a0974cb211822c50b35b6782.tar.gz gcc-c0ee00211f683cd8a0974cb211822c50b35b6782.tar.bz2 |
re PR middle-end/38074 (missed inlining on Core2 Duo due to apparent wrong branch prediction/profile)
PR tree-optimization/38074
* cgraphbuild.c (compute_call_stmt_bb_frequency): Fix handling of 0
entry frequency.
* predict.c (combine_predictions_for_bb): Ignore predictor predicting
in both dirrection for first match heuristics.
(tree_bb_level_predictions): Disable noreturn heuristic when there
is no returning path.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r142517
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r-- | gcc/cgraphbuild.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index 958fed7..75db875 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -109,13 +109,12 @@ int compute_call_stmt_bb_frequency (basic_block bb) { int entry_freq = ENTRY_BLOCK_PTR->frequency; - int freq; + int freq = bb->frequency; if (!entry_freq) - entry_freq = 1; + entry_freq = 1, freq++; - freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE - : bb->frequency * CGRAPH_FREQ_BASE / entry_freq); + freq = freq * CGRAPH_FREQ_BASE / entry_freq; if (freq > CGRAPH_FREQ_MAX) freq = CGRAPH_FREQ_MAX; |