aboutsummaryrefslogtreecommitdiff
path: root/gcc/params.def
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2013-10-03 17:13:50 +0000
committerRong Xu <xur@gcc.gnu.org>2013-10-03 17:13:50 +0000
commit942df7390fb64e26bb7ed6ac58ee9911be4ea5cb (patch)
tree48352394b524e6a8198bc62633939861961f8a7e /gcc/params.def
parent2ef7251f6cd9e228cafa3473929ff55c9cb56928 (diff)
downloadgcc-942df7390fb64e26bb7ed6ac58ee9911be4ea5cb.zip
gcc-942df7390fb64e26bb7ed6ac58ee9911be4ea5cb.tar.gz
gcc-942df7390fb64e26bb7ed6ac58ee9911be4ea5cb.tar.bz2
predict.c (tree_predict_by_opcode): Get the probability for builtin_expect from param builtin_expect_probability.
* predict.c (tree_predict_by_opcode): Get the probability for builtin_expect from param builtin_expect_probability. * params.def (BUILTIN_EXPECT_PROBABILITY): New parameter. * predict.def (PRED_BUILTIN_EXPECT_RELAXED): Fix comments. * doc/invoke.texi: Add documentation for builtin-expect-probability. * gcc.target/i386/cold-attribute-2.c: Fix the test by using original probability. * gcc.dg/tree-ssa/ipa-split-5.c: Ditto. * gcc.dg/tree-ssa/ipa-split-6.c: Ditto. --This li (t)ene, and those below, will be ignored-- M gcc/params.def M gcc/predict.def M gcc/ChangeLog M gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c M gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c M gcc/testsuite/gcc.target/i386/cold-attribute-2.c M gcc/predict.c M gcc/doc/invoke.texi From-SVN: r203167
Diffstat (limited to 'gcc/params.def')
-rw-r--r--gcc/params.def13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/params.def b/gcc/params.def
index 2749137..ff9ba9a 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -398,6 +398,19 @@ DEFPARAM(PARAM_MAX_PREDICTED_ITERATIONS,
"max-predicted-iterations",
"The maximum number of loop iterations we predict statically",
100, 0, 0)
+
+/* This parameter controls the probability of builtin_expect. The default
+ value is 90%. This empirical value is obtained through the weighted
+ probability of FDO counters (with the FDO count value as the weight)
+ in some real world programs:
+ (1) Google performance test benchmarks: the probability is 0.9081.
+ (2) Linux 3.3 kernel running Google search workload: the probability
+ is 0.8717. */
+
+DEFPARAM(BUILTIN_EXPECT_PROBABILITY,
+ "builtin-expect-probability",
+ "Set the estimated probability in percentage for builtin expect. The default value is 90% probability.",
+ 90, 0, 100)
DEFPARAM(TRACER_DYNAMIC_COVERAGE_FEEDBACK,
"tracer-dynamic-coverage-feedback",
"The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is available",