This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
First feedback for branch predictors
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com, patches at x86-64 dot org
- Subject: First feedback for branch predictors
- From: Jan Hubicka <jh at suse dot cz>
- Date: Wed, 8 Aug 2001 17:50:06 +0200
Hi,
finally, the first results of spec2000 profiled run are here. They can be more
accurate with patch http://gcc.gnu.org/ml/gcc-patches/2001-07/msg02176.html,
but stil they are interesting.
HEURISTICS BRANCHES (REL) HITRATE COVERAGE (REL)
opcode 57040 79.2% 53.37%/ 92.55% 17246614983 66.1%
error return 4078 5.7% 78.41%/ 90.29% 3155933231 12.1%
first match 71997 100.0% 74.87%/ 92.26% 26080949397 100.0%
combined 71997 100.0% 75.15%/ 92.26% 26080949397 100.0%
call 22643 31.4% 66.63%/ 93.67% 3774889448 14.5%
loop branch 6934 9.6% 89.83%/ 94.23% 6895367616 26.4%
loop header 6778 9.4% 59.57%/ 88.37% 1369503403 5.2%
loop exit 8964 12.5% 92.51%/ 96.05% 5966820582 22.9%
loop iterations 562 0.8% 99.52%/ 99.52% 363014168 1.4%
pointer 5387 7.5% 75.98%/ 84.25% 1006919443 3.9%
noreturn call 1176 1.6% 99.99%/ 99.99% 231734365 0.9%
Comparing the results with Ball & Larus paper, we do have considerably worse
hitrate for opcode (this is really important), loop header (this has been
noticed by other papers too).
On the other hand, we do have better results of pointer heuristics, but this is
expectable, as we deal only with real pointers, unlike the original paper did.
I am installing the attached patch to predict.def to make probabilities match
reality. In next patch I would like to address the opcode heuristic problems
at least partly.
Honza
Wed Aug 8 17:28:16 CEST 2001 Jan Hubicka <jh@suse.cz>
* predict.def: Set hitrates according our experimental run.
Index: predict.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/predict.def,v
retrieving revision 1.7
diff -c -3 -p -r1.7 predict.def
*** predict.def 2001/07/30 15:54:12 1.7
--- predict.def 2001/08/08 15:26:15
*************** DEF_PREDICTOR (PRED_LOOP_BRANCH, "loop b
*** 66,72 ****
PRED_FLAG_FIRST_MATCH)
/* Edge causing loop to terminate is probably not taken. */
! DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (80),
PRED_FLAG_FIRST_MATCH)
/* Condition emitted by preconditiong code to ensure that variable
--- 66,72 ----
PRED_FLAG_FIRST_MATCH)
/* Edge causing loop to terminate is probably not taken. */
! DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (92),
PRED_FLAG_FIRST_MATCH)
/* Condition emitted by preconditiong code to ensure that variable
*************** DEF_PREDICTOR (PRED_LOOP_CONDITION, "loo
*** 77,92 ****
DEF_PREDICTOR (PRED_LOOP_PRECONDITIONING, "loop preconditioning", PROB_VERY_LIKELY, 0)
/* Copied condition for the first iteration of loop is probably true. */
! DEF_PREDICTOR (PRED_LOOP_HEADER, "loop header", HITRATE (75), 0)
/* Pointers are usually not NULL. */
! DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (60), 0)
/* NE is probable, EQ not etc... */
! DEF_PREDICTOR (PRED_OPCODE, "opcode", HITRATE (84), 0)
/* Branch guarding call is probably taken. */
! DEF_PREDICTOR (PRED_CALL, "call", HITRATE (78), 0)
/* Branch causing function to terminate is probably not taken. */
DEF_PREDICTOR (PRED_ERROR_RETURN, "error return", PROB_LIKELY, 0)
--- 77,92 ----
DEF_PREDICTOR (PRED_LOOP_PRECONDITIONING, "loop preconditioning", PROB_VERY_LIKELY, 0)
/* Copied condition for the first iteration of loop is probably true. */
! DEF_PREDICTOR (PRED_LOOP_HEADER, "loop header", HITRATE (60), 0)
/* Pointers are usually not NULL. */
! DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (75), 0)
/* NE is probable, EQ not etc... */
! DEF_PREDICTOR (PRED_OPCODE, "opcode", HITRATE (53), 0)
/* Branch guarding call is probably taken. */
! DEF_PREDICTOR (PRED_CALL, "call", HITRATE (66), 0)
/* Branch causing function to terminate is probably not taken. */
DEF_PREDICTOR (PRED_ERROR_RETURN, "error return", PROB_LIKELY, 0)