diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2016-06-07 23:34:27 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2016-06-07 21:34:27 +0000 |
commit | d1fcc2bdef93fa453b326749888275c80e39cefc (patch) | |
tree | a4741a4afa5e4271b8f222101f278886481db7fb /gcc/predict.def | |
parent | 373c00952c0a3cb0224f2259487f6481c3c946e9 (diff) | |
download | gcc-d1fcc2bdef93fa453b326749888275c80e39cefc.zip gcc-d1fcc2bdef93fa453b326749888275c80e39cefc.tar.gz gcc-d1fcc2bdef93fa453b326749888275c80e39cefc.tar.bz2 |
predict.c (predict_iv_comparison): Mention that heuristics is broken.
* predict.c (predict_iv_comparison): Mention that heuristics is broken.
(return_prediction): PRED_CONST_RETURN predict return as not taken.
* predict.def (PRED_CONTINUE): Change hitrate 50->67
(PRED_LOOP_BRANCH): Document predictor as broken.
(PRED_LOOP_EXIT): Change hitrate 91->92.
(PRED_LOOP_EXTRA_EXIT): Change hitrate 91->83.
(PRED_POINTER, PRED_TREE_POINTER): Change hitrate 85->70.
(PRED_OPCODE_POSITIVE): Change hitrate 79->64.
(PRED_OPCODE_NONEQUAL): Change hitrate 91->66.
(PRED_TREE_OPCODE_POSITIVE): Change hitrate 73->64
(PRED_TREE_OPCODE_NONEQUAL): Chnage hitrate 72->66
(PRED_CALL): Chane hitrate 71->67.
(PRED_TREE_EARLY_RETURN): Document issues, change hitrate 61->54.
(PRED_GOTO): Document as unused right now.
(PRED_CONST_RETURN): Change hitrate 67->69
(PRED_NEGATIVE_RETURN): Change hitrate 96->98
(PRED_NULL_RETURN): Change hitrate 91->90.
(PRED_LOOP_IV_COMPARE_GUESS): Change hitrate to 98.
(PRED_FORTRAN_FAIL_ALLOC): Change hitrate to 62; document issues.
(PRED_FORTRAN_SIZE_ZERO): Change hitrate to 99.
* gcc.dg/ipa/inlinehint-4.c: Disable partial inlining.
* gcc.dg/predict-1.c: Update template for new predictor hitrates.
* gcc.dg/predict-3.c: Update template.
* gcc.dg/predict-5.c: Update template.
* gcc.dg/predict-6.c: Update template.
* gcc.dg/predict-9.c: Update template.
* gcc.dg/predict-9.c: Update template.
* gcc.dg/tree-ssa/attr-hotcold-2.c: Update template.
From-SVN: r237185
Diffstat (limited to 'gcc/predict.def')
-rw-r--r-- | gcc/predict.def | 64 |
1 files changed, 39 insertions, 25 deletions
diff --git a/gcc/predict.def b/gcc/predict.def index 9c7db7a..e1c5fae 100644 --- a/gcc/predict.def +++ b/gcc/predict.def @@ -78,7 +78,7 @@ DEF_PREDICTOR (PRED_LOOP_ITERATIONS_MAX, "guessed loop iterations", PROB_ALWAYS, PRED_FLAG_FIRST_MATCH) /* Branch containing goto is probably not taken. */ -DEF_PREDICTOR (PRED_CONTINUE, "continue", HITRATE (50), 0) +DEF_PREDICTOR (PRED_CONTINUE, "continue", HITRATE (67), 0) /* Branch to basic block containing call marked by noreturn attribute. */ DEF_PREDICTOR (PRED_NORETURN, "noreturn call", PROB_VERY_LIKELY, @@ -88,53 +88,66 @@ DEF_PREDICTOR (PRED_NORETURN, "noreturn call", PROB_VERY_LIKELY, DEF_PREDICTOR (PRED_COLD_FUNCTION, "cold function call", PROB_VERY_LIKELY, PRED_FLAG_FIRST_MATCH) -/* Loopback edge is taken. */ +/* Loopback edge is taken. + FIXME: This is currently disabled because loop_optimizer_init force + loops to have simple latches. */ DEF_PREDICTOR (PRED_LOOP_BRANCH, "loop branch", HITRATE (86), PRED_FLAG_FIRST_MATCH) /* Edge causing loop to terminate is probably not taken. */ -DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (91), +DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (92), PRED_FLAG_FIRST_MATCH) -/* Edge causing loop to terminate by computing value used by later conditional. - */ -DEF_PREDICTOR (PRED_LOOP_EXTRA_EXIT, "extra loop exit", HITRATE (91), +/* Edge causing loop to terminate by computing value used by later + conditional. */ +DEF_PREDICTOR (PRED_LOOP_EXTRA_EXIT, "extra loop exit", HITRATE (83), PRED_FLAG_FIRST_MATCH) /* Pointers are usually not NULL. */ -DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (85), 0) -DEF_PREDICTOR (PRED_TREE_POINTER, "pointer (on trees)", HITRATE (85), 0) +DEF_PREDICTOR (PRED_POINTER, "pointer", HITRATE (70), 0) +DEF_PREDICTOR (PRED_TREE_POINTER, "pointer (on trees)", HITRATE (70), 0) /* NE is probable, EQ not etc... */ -DEF_PREDICTOR (PRED_OPCODE_POSITIVE, "opcode values positive", HITRATE (79), 0) -DEF_PREDICTOR (PRED_OPCODE_NONEQUAL, "opcode values nonequal", HITRATE (71), 0) +DEF_PREDICTOR (PRED_OPCODE_POSITIVE, "opcode values positive", HITRATE (64), 0) +DEF_PREDICTOR (PRED_OPCODE_NONEQUAL, "opcode values nonequal", HITRATE (66), 0) DEF_PREDICTOR (PRED_FPOPCODE, "fp_opcode", HITRATE (90), 0) -DEF_PREDICTOR (PRED_TREE_OPCODE_POSITIVE, "opcode values positive (on trees)", HITRATE (73), 0) -DEF_PREDICTOR (PRED_TREE_OPCODE_NONEQUAL, "opcode values nonequal (on trees)", HITRATE (72), 0) +DEF_PREDICTOR (PRED_TREE_OPCODE_POSITIVE, "opcode values positive (on trees)", HITRATE (64), 0) +DEF_PREDICTOR (PRED_TREE_OPCODE_NONEQUAL, "opcode values nonequal (on trees)", HITRATE (66), 0) DEF_PREDICTOR (PRED_TREE_FPOPCODE, "fp_opcode (on trees)", HITRATE (90), 0) /* Branch guarding call is probably taken. */ -DEF_PREDICTOR (PRED_CALL, "call", HITRATE (71), 0) - -/* Branch causing function to terminate is probably not taken. */ -DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (61), 0) - -/* Branch containing goto is probably not taken. */ +DEF_PREDICTOR (PRED_CALL, "call", HITRATE (67), 0) + +/* Branch causing function to terminate is probably not taken. + FIXME: early return currently predicts code: + int foo (int a) + { + if (a) + bar(); + else + bar2(); + } + even though there is no return statement involved. We probably want to track + this from FE or retire the predictor. */ +DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (54), 0) + +/* Branch containing goto is probably not taken. + FIXME: Currently not used. */ DEF_PREDICTOR (PRED_GOTO, "goto", HITRATE (70), 0) /* Branch ending with return constant is probably not taken. */ -DEF_PREDICTOR (PRED_CONST_RETURN, "const return", HITRATE (67), 0) +DEF_PREDICTOR (PRED_CONST_RETURN, "const return", HITRATE (69), 0) /* Branch ending with return negative constant is probably not taken. */ -DEF_PREDICTOR (PRED_NEGATIVE_RETURN, "negative return", HITRATE (96), 0) +DEF_PREDICTOR (PRED_NEGATIVE_RETURN, "negative return", HITRATE (98), 0) /* Branch ending with return; is probably not taken */ -DEF_PREDICTOR (PRED_NULL_RETURN, "null return", HITRATE (90), 0) +DEF_PREDICTOR (PRED_NULL_RETURN, "null return", HITRATE (91), 0) /* Branches to compare induction variable to a loop bound is extremely likely. */ DEF_PREDICTOR (PRED_LOOP_IV_COMPARE_GUESS, "guess loop iv compare", - PROB_VERY_LIKELY, 0) + HITRATE (98), 0) /* Use number of loop iterations determined by # of iterations analysis to set probability of branches that compares IV to loop bound variable. */ @@ -159,8 +172,9 @@ DEF_PREDICTOR (PRED_FORTRAN_OVERFLOW, "overflow", PROB_ALWAYS, of memory or when trying to allocate an already allocated allocated or deallocating an already deallocated allocatable. This predictor only occurs when the user explicitly asked for a return status. By default, - the code aborts, which is handled via PRED_NORETURN. */ -DEF_PREDICTOR (PRED_FORTRAN_FAIL_ALLOC, "fail alloc", PROB_VERY_LIKELY, 0) + the code aborts, which is handled via PRED_NORETURN. + FIXME: the hitrate really ought to be close to 100%. */ +DEF_PREDICTOR (PRED_FORTRAN_FAIL_ALLOC, "fail alloc", HITRATE (62), 0) /* Branch leading to an I/O failure status are unlikely. This predictor is used for I/O failures such as for invalid unit numbers. This predictor @@ -173,7 +187,7 @@ DEF_PREDICTOR (PRED_FORTRAN_FAIL_IO, "fail IO", HITRATE (85), 0) DEF_PREDICTOR (PRED_FORTRAN_WARN_ONCE, "warn once", HITRATE (75), 0) /* Branch belonging to a zero-sized array. */ -DEF_PREDICTOR (PRED_FORTRAN_SIZE_ZERO, "zero-sized array", HITRATE(70), 0) +DEF_PREDICTOR (PRED_FORTRAN_SIZE_ZERO, "zero-sized array", HITRATE(99), 0) /* Branch belonging to an invalid bound index, in a context where it is standard conform and well defined but rather pointless and, hence, rather |