comparison gcc/predict.def @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Definitions for the branch prediction routines in the GNU compiler. 1 /* Definitions for the branch prediction routines in the GNU compiler.
2 Copyright (C) 2001-2018 Free Software Foundation, Inc. 2 Copyright (C) 2001-2020 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
74 PRED_FLAG_FIRST_MATCH) 74 PRED_FLAG_FIRST_MATCH)
75 75
76 /* Hints provided by user via __builtin_expect_with_probability. */ 76 /* Hints provided by user via __builtin_expect_with_probability. */
77 DEF_PREDICTOR (PRED_BUILTIN_EXPECT_WITH_PROBABILITY, 77 DEF_PREDICTOR (PRED_BUILTIN_EXPECT_WITH_PROBABILITY,
78 "__builtin_expect_with_probability", PROB_UNINITIALIZED, 78 "__builtin_expect_with_probability", PROB_UNINITIALIZED,
79 PRED_FLAG_FIRST_MATCH)
80
81 /* Branches to hot labels are likely. */
82 DEF_PREDICTOR (PRED_HOT_LABEL, "hot label", HITRATE (90),
83 PRED_FLAG_FIRST_MATCH)
84
85 /* Branches to cold labels are extremely unlikely. */
86 DEF_PREDICTOR (PRED_COLD_LABEL, "cold label", HITRATE (90),
79 PRED_FLAG_FIRST_MATCH) 87 PRED_FLAG_FIRST_MATCH)
80 88
81 /* Use number of loop iterations guessed by the contents of the loop. */ 89 /* Use number of loop iterations guessed by the contents of the loop. */
82 DEF_PREDICTOR (PRED_LOOP_ITERATIONS_GUESSED, "guessed loop iterations", 90 DEF_PREDICTOR (PRED_LOOP_ITERATIONS_GUESSED, "guessed loop iterations",
83 PROB_UNINITIALIZED, PRED_FLAG_FIRST_MATCH) 91 PROB_UNINITIALIZED, PRED_FLAG_FIRST_MATCH)
169 177
170 /* Same but for loops containing recursion. */ 178 /* Same but for loops containing recursion. */
171 DEF_PREDICTOR (PRED_LOOP_GUARD_WITH_RECURSION, "loop guard with recursion", 179 DEF_PREDICTOR (PRED_LOOP_GUARD_WITH_RECURSION, "loop guard with recursion",
172 HITRATE (85), 0) 180 HITRATE (85), 0)
173 181
174 /* Branches to hot labels are likely. */
175 DEF_PREDICTOR (PRED_HOT_LABEL, "hot label", HITRATE (85), 0)
176
177 /* Branches to cold labels are extremely unlikely. */
178 DEF_PREDICTOR (PRED_COLD_LABEL, "cold label", PROB_VERY_LIKELY,
179 PRED_FLAG_FIRST_MATCH)
180
181 /* The following predictors are used in Fortran. */ 182 /* The following predictors are used in Fortran. */
182 183
183 /* Branch leading to an integer overflow are extremely unlikely. */ 184 /* Branch leading to an integer overflow are extremely unlikely. */
184 DEF_PREDICTOR (PRED_FORTRAN_OVERFLOW, "Fortran overflow", PROB_ALWAYS, 185 DEF_PREDICTOR (PRED_FORTRAN_OVERFLOW, "Fortran overflow", PROB_ALWAYS,
185 PRED_FLAG_FIRST_MATCH) 186 PRED_FLAG_FIRST_MATCH)
226 /* Fortran DO statement generates a pre-header guard: 227 /* Fortran DO statement generates a pre-header guard:
227 empty = (step > 0 ? to < from : to > from), which can be predicted 228 empty = (step > 0 ? to < from : to > from), which can be predicted
228 to be very likely. */ 229 to be very likely. */
229 DEF_PREDICTOR (PRED_FORTRAN_LOOP_PREHEADER, "Fortran loop preheader", \ 230 DEF_PREDICTOR (PRED_FORTRAN_LOOP_PREHEADER, "Fortran loop preheader", \
230 HITRATE (99), 0) 231 HITRATE (99), 0)
232
233 /* Fortran assumed size arrays can be non-contiguous, so they need
234 to be repacked. */
235
236 DEF_PREDICTOR (PRED_FORTRAN_CONTIGUOUS, "Fortran contiguous", \
237 HITRATE (75), 0)
238