Commit d7e2ecf3 by Pat Haugen Committed by Pat Haugen

rs6000.c (output_cbranch): Don't statically predict branches if using guessed profile.

	* config/rs6000/rs6000.c (output_cbranch): Don't statically predict
	branches if using guessed profile.

From-SVN: r232945
parent 2036f413
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> 2016-01-28 H.J. Lu <hongjiu.lu@intel.com>
* graphite-optimize-isl.c (optimize_isl): Fix dump. * graphite-optimize-isl.c (optimize_isl): Fix dump.
......
...@@ -21432,14 +21432,15 @@ output_cbranch (rtx op, const char *label, int reversed, rtx_insn *insn) ...@@ -21432,14 +21432,15 @@ output_cbranch (rtx op, const char *label, int reversed, rtx_insn *insn)
/* PROB is the difference from 50%. */ /* PROB is the difference from 50%. */
int prob = XINT (note, 0) - REG_BR_PROB_BASE / 2; int prob = XINT (note, 0) - REG_BR_PROB_BASE / 2;
/* Only hint for highly probable/improbable branches on newer /* Only hint for highly probable/improbable branches on newer cpus when
cpus as static prediction overrides processor dynamic we have real profile data, as static prediction overrides processor
prediction. For older cpus we may as well always hint, but 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 assume not taken for branches that are very close to 50% as a
mispredicted taken branch is more expensive than a mispredicted taken branch is more expensive than a
mispredicted not-taken branch. */ mispredicted not-taken branch. */
if (rs6000_always_hint if (rs6000_always_hint
|| (abs (prob) > REG_BR_PROB_BASE / 100 * 48 || (abs (prob) > REG_BR_PROB_BASE / 100 * 48
&& (profile_status_for_fn (cfun) != PROFILE_GUESSED)
&& br_prob_note_reliable_p (note))) && br_prob_note_reliable_p (note)))
{ {
if (abs (prob) > REG_BR_PROB_BASE / 20 if (abs (prob) > REG_BR_PROB_BASE / 20
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment