summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpthaugen <pthaugen@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-28 20:34:49 +0000
committerpthaugen <pthaugen@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-28 20:34:49 +0000
commit3c8e7539c5905bfb2af3a74bbef9a4a5c26eed5d (patch)
tree1519763a6137e7f5a9bde0c18fa68ec1cd3cd27f
parent2e251de5de89de489823ebbfad0363ffb147e56b (diff)
downloadgcc-3c8e7539c5905bfb2af3a74bbef9a4a5c26eed5d.tar.gz
* config/rs6000/rs6000.c (output_cbranch): Don't statically predict
branches if using guessed profile. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232945 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rs6000/rs6000.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 20e16f2d0f0..c2df5a036fc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-28 Pat Haugen <pthaugen@us.ibm.com>
+
+ * config/rs6000/rs6000.c (output_cbranch): Don't statically predict
+ branches if using guessed profile.
+
2016-01-28 H.J. Lu <hongjiu.lu@intel.com>
* graphite-optimize-isl.c (optimize_isl): Fix dump.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e9e12f53020..41f53adc0c3 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -21432,14 +21432,15 @@ output_cbranch (rtx op, const char *label, int reversed, rtx_insn *insn)
/* PROB is the difference from 50%. */
int prob = XINT (note, 0) - REG_BR_PROB_BASE / 2;
- /* Only hint for highly probable/improbable branches on newer
- cpus as static prediction overrides processor dynamic
- prediction. For older cpus we may as well always hint, but
+ /* Only hint for highly probable/improbable branches on newer cpus when
+ we have real profile data, as static prediction overrides processor
+ dynamic prediction. For older cpus we may as well always hint, but
assume not taken for branches that are very close to 50% as a
mispredicted taken branch is more expensive than a
mispredicted not-taken branch. */
if (rs6000_always_hint
|| (abs (prob) > REG_BR_PROB_BASE / 100 * 48
+ && (profile_status_for_fn (cfun) != PROFILE_GUESSED)
&& br_prob_note_reliable_p (note)))
{
if (abs (prob) > REG_BR_PROB_BASE / 20