From 2bbcff9a18f6212b41d755bb8b6e219039f8c390 Mon Sep 17 00:00:00 2001 From: marxin Date: Fri, 19 Jan 2018 12:06:18 +0000 Subject: [PATCH] Adjust predictor values according to SPEC2006 and SPEC2017. 2018-01-19 Martin Liska * predict.def (PRED_LOOP_EXIT): Change from 85 to 89. (PRED_LOOP_EXIT_WITH_RECURSION): Change from 72 to 78. (PRED_LOOP_EXTRA_EXIT): Change from 83 to 67. (PRED_OPCODE_POSITIVE): Change from 64 to 59. (PRED_TREE_OPCODE_POSITIVE): Change from 64 to 59. (PRED_CONST_RETURN): Change from 69 to 65. (PRED_NULL_RETURN): Change from 91 to 71. (PRED_LOOP_IV_COMPARE_GUESS): Change from 98 to 64. (PRED_LOOP_GUARD): Change from 66 to 73. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256888 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 12 ++++++++++++ gcc/predict.def | 18 +++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 38c85feb83e..de744567073 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,17 @@ 2018-01-19 Martin Liska + * predict.def (PRED_LOOP_EXIT): Change from 85 to 89. + (PRED_LOOP_EXIT_WITH_RECURSION): Change from 72 to 78. + (PRED_LOOP_EXTRA_EXIT): Change from 83 to 67. + (PRED_OPCODE_POSITIVE): Change from 64 to 59. + (PRED_TREE_OPCODE_POSITIVE): Change from 64 to 59. + (PRED_CONST_RETURN): Change from 69 to 65. + (PRED_NULL_RETURN): Change from 91 to 71. + (PRED_LOOP_IV_COMPARE_GUESS): Change from 98 to 64. + (PRED_LOOP_GUARD): Change from 66 to 73. + +2018-01-19 Martin Liska + * predict.c (predict_insn_def): Add new assert. (struct branch_predictor): Change type to signed integer. (test_prediction_value_range): Amend test to cover diff --git a/gcc/predict.def b/gcc/predict.def index 390b9a35fa7..fe72080d5bd 100644 --- a/gcc/predict.def +++ b/gcc/predict.def @@ -89,16 +89,16 @@ DEF_PREDICTOR (PRED_COLD_FUNCTION, "cold function call", PROB_VERY_LIKELY, PRED_FLAG_FIRST_MATCH) /* Edge causing loop to terminate is probably not taken. */ -DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (85), +DEF_PREDICTOR (PRED_LOOP_EXIT, "loop exit", HITRATE (89), PRED_FLAG_FIRST_MATCH) /* Same as LOOP_EXIT but for loops containing recursive call. */ DEF_PREDICTOR (PRED_LOOP_EXIT_WITH_RECURSION, "loop exit with recursion", - HITRATE (72), PRED_FLAG_FIRST_MATCH) + HITRATE (78), 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 (83), +DEF_PREDICTOR (PRED_LOOP_EXTRA_EXIT, "extra loop exit", HITRATE (67), PRED_FLAG_FIRST_MATCH) /* Pointers are usually not NULL. */ @@ -106,11 +106,11 @@ 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 (64), 0) +DEF_PREDICTOR (PRED_OPCODE_POSITIVE, "opcode values positive", HITRATE (59), 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 (64), 0) + HITRATE (59), 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) @@ -136,18 +136,18 @@ DEF_PREDICTOR (PRED_TREE_EARLY_RETURN, "early return (on trees)", HITRATE (66), DEF_PREDICTOR (PRED_GOTO, "goto", HITRATE (66), 0) /* Branch ending with return constant is probably not taken. */ -DEF_PREDICTOR (PRED_CONST_RETURN, "const return", HITRATE (69), 0) +DEF_PREDICTOR (PRED_CONST_RETURN, "const return", HITRATE (65), 0) /* Branch ending with return negative constant is probably not taken. */ 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 (91), 0) +DEF_PREDICTOR (PRED_NULL_RETURN, "null return", HITRATE (71), 0) /* Branches to compare induction variable to a loop bound is extremely likely. */ DEF_PREDICTOR (PRED_LOOP_IV_COMPARE_GUESS, "guess loop iv compare", - HITRATE (98), 0) + HITRATE (64), 0) /* Use number of loop iterations determined by # of iterations analysis to set probability of branches that compares IV to loop bound variable. */ @@ -160,7 +160,7 @@ DEF_PREDICTOR (PRED_LOOP_IV_COMPARE, "loop iv compare", PROB_UNINITIALIZED, for (loop2) body; guess that cond is unlikely. */ -DEF_PREDICTOR (PRED_LOOP_GUARD, "loop guard", HITRATE (66), 0) +DEF_PREDICTOR (PRED_LOOP_GUARD, "loop guard", HITRATE (73), 0) /* Same but for loops containing recursion. */ DEF_PREDICTOR (PRED_LOOP_GUARD_WITH_RECURSION, "loop guard with recursion", -- 2.11.4.GIT