#include "config.h"#include "system.h"#include "coretypes.h"#include "tm.h"#include "tree.h"#include "rtl.h"#include "tm_p.h"#include "hard-reg-set.h"#include "basic-block.h"#include "insn-config.h"#include "regs.h"#include "flags.h"#include "output.h"#include "function.h"#include "except.h"#include "toplev.h"#include "recog.h"#include "expr.h"#include "predict.h"#include "coverage.h"#include "sreal.h"#include "params.h"#include "target.h"#include "cfgloop.h"#include "tree-flow.h"#include "ggc.h"#include "tree-dump.h"#include "tree-pass.h"#include "timevar.h"#include "tree-scalar-evolution.h"#include "predict.def"

Go to the source code of this file.
| #define BLOCK_INFO | ( | B | ) | ((block_info) (B)->aux) |
| #define DEF_PREDICTOR | ( | ENUM, | |||
| NAME, | |||||
| HITRATE, | |||||
| FLAGS | ) | {NAME, HITRATE, FLAGS}, |
| #define HITRATE | ( | VAL | ) | ((int) ((VAL) * REG_BR_PROB_BASE + 50) / 100) |
| #define PROB_VERY_LIKELY (REG_BR_PROB_BASE - PROB_VERY_UNLIKELY) |
| typedef struct block_info_def * block_info |
| typedef struct edge_info_def * edge_info |
| static void apply_return_prediction | ( | int * | heads | ) | [static] |
Definition at line 1191 of file predict.c.
References EXIT_BLOCK_PTR, FOR_EACH_EDGE, i, last_stmt(), NULL, PHI_ARG_DEF, PHI_ARG_EDGE, PHI_CHAIN, PHI_NUM_ARGS, PHI_RESULT, predict_paths_leading_to(), return_prediction(), src, edge::src, SSA_NAME, SSA_NAME_DEF_STMT, TREE_CODE, and TREE_OPERAND.
| static void bb_estimate_probability_locally | ( | basic_block | bb | ) | [static] |
Definition at line 792 of file predict.c.
References BB_END, can_predict_insn_p(), COMPARISON_P, cond, const0_rtx, const1_rtx, constm1_rtx, EQ, FLOAT_MODE_P, GE, GET_CODE, get_condition(), GET_MODE, GT, last_insn, LE, LT, NE, NOT_TAKEN, NULL, predict_insn_def(), REG_P, REG_POINTER, TAKEN, and XEXP.
Definition at line 217 of file predict.c.
References gcc_assert, INTVAL, probability_reliable_p(), REG_BR_PROB, REG_NOTE_KIND, and XEXP.
Referenced by ia64_print_operand(), and output_cbranch().
Definition at line 312 of file predict.c.
References any_condjump_p(), BLOCK_FOR_INSN, EDGE_COUNT, and JUMP_P.
Definition at line 1880 of file predict.c.
References build_string(), cfun, current_function_decl, DECL_ONE_ONLY, DECL_SECTION_NAME, FUNCTION_FREQUENCY_HOT, FUNCTION_FREQUENCY_UNLIKELY_EXECUTED, gcc_target::have_named_sections, HOT_TEXT_SECTION_NAME, strlen(), targetm, and UNLIKELY_EXECUTED_TEXT_SECTION_NAME.
| static void combine_predictions_for_bb | ( | basic_block | bb | ) | [static] |
Definition at line 523 of file predict.c.
References basic_block_def::count, d, double, dump_file, dump_prediction(), EDGE_EH, EDGE_FAKE, EDGE_SUCC, first, edge::flags, flags, FOR_EACH_EDGE, fprintf(), basic_block_def::index, NULL, PRED_FLAG_FIRST_MATCH, PROB_EVEN, REG_BR_PROB_BASE, second(), and set_even_probabilities().
| static void combine_predictions_for_insn | ( | rtx | insn, | |
| basic_block | bb | |||
| ) | [static] |
Definition at line 407 of file predict.c.
References BRANCH_EDGE, can_predict_insn_p(), d, double, dump_file, dump_prediction(), FALLTHRU_EDGE, find_reg_note(), flags, fprintf(), GEN_INT, gen_rtx_EXPR_LIST, basic_block_def::index, INSN_UID, INTVAL, PRED_FLAG_FIRST_MATCH, PROB_EVEN, REG_BR_PRED, REG_BR_PROB, REG_BR_PROB_BASE, REG_NOTE_KIND, REG_NOTES, set_even_probabilities(), single_succ_edge(), single_succ_p(), and XEXP.
Definition at line 1859 of file predict.c.
References cfun, flag_branch_probabilities, FOR_EACH_BB, FUNCTION_FREQUENCY_HOT, FUNCTION_FREQUENCY_NORMAL, FUNCTION_FREQUENCY_UNLIKELY_EXECUTED, maybe_hot_bb_p(), and probably_never_executed_bb_p().
| int counts_to_freqs | ( | void | ) |
Definition at line 1727 of file predict.c.
References BB_FREQ_MAX, basic_block_def::count, ENTRY_BLOCK_PTR, FOR_BB_BETWEEN, FOR_EACH_BB, basic_block_def::frequency, MAX, and NULL.
| static void dump_prediction | ( | FILE * | file, | |
| enum br_predictor | predictor, | |||
| int | probability, | |||
| basic_block | bb, | |||
| int | used | |||
| ) | [static] |
Definition at line 352 of file predict.c.
References basic_block_def::count, EDGE_FALLTHRU, edge::flags, FOR_EACH_EDGE, fprintf(), HOST_WIDEST_INT_PRINT_DEC, and REG_BR_PROB_BASE.
Definition at line 1785 of file predict.c.
References alloc_aux_for_blocks(), alloc_aux_for_edges(), BB_FREQ_MAX, BITMAP_ALLOC, BITMAP_FREE, BLOCK_INFO, choose_function_section(), compute_function_frequency(), counts_to_freqs(), EDGE_INFO, ENTRY_BLOCK_PTR, estimate_loops_at_level(), flag_branch_probabilities, flag_reorder_functions, FOR_BB_BETWEEN, FOR_EACH_BB, FOR_EACH_EDGE, free_aux_for_blocks(), free_aux_for_edges(), basic_block_def::frequency, frequency, mark_dfs_back_edges(), memcpy, NULL, REG_BR_PROB_BASE, single_succ_edge(), sreal_add(), sreal_compare(), sreal_div(), sreal_init(), sreal_mul(), sreal_sub(), sreal_to_int(), tmp, and loops::tree_root.
Definition at line 1695 of file predict.c.
References bitmap_set_bit(), EDGE_COUNT, EDGE_INFO, estimate_loops_at_level(), free(), get_loop_body(), i, index(), loop::inner, loop::latch, loop_latch_edge(), loop::next, loop::num_nodes, and propagate_freq().
Definition at line 1387 of file predict.c.
References abort, any_condjump_p(), canonicalize_condition(), cond, const0_rtx, delete_insn(), gcc_assert, gen_rtx_fmt_ee(), GET_CODE, get_insns(), insn, JUMP_P, NEXT_INSN, NOT_TAKEN, NOTE_EXPECTED_VALUE, NOTE_INSN_EXPECTED_VALUE, NOTE_LINE_NUMBER, NULL, NULL_RTX, pc_set(), predict_insn_def(), reg_set_p(), SET_SRC, simplify_rtx(), TAKEN, and XEXP.
| bool expensive_function_p | ( | int | threshold | ) |
Definition at line 1747 of file predict.c.
References abort, active_insn_p(), BB_END, BB_FREQ_MAX, BB_HEAD, basic_block_def::end, ENTRY_BLOCK_PTR, FOR_EACH_BB, basic_block_def::frequency, gcc_assert, basic_block_def::head, insn, and NEXT_INSN.
Definition at line 905 of file predict.c.
References BINARY_CLASS_P, bitmap_bit_p(), bitmap_set_bit(), BUILT_IN_NORMAL, COMPARISON_CLASS_P, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE, expr_expected_value(), fold_build1, fold_build2, get_callee_fndecl(), i, NULL, NULL_TREE, operand_equal_p(), PHI_ARG_DEF, PHI_NUM_ARGS, PHI_RESULT, SSA_NAME, SSA_NAME_DEF_STMT, SSA_NAME_VERSION, TREE_CHAIN, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_TYPE, TREE_VALUE, UNARY_CLASS_P, and val.
| void guess_outgoing_edge_probabilities | ( | basic_block | bb | ) |
Definition at line 890 of file predict.c.
References BB_END, bb_estimate_probability_locally(), and combine_predictions_for_insn().
Referenced by compute_outgoing_frequencies().
Definition at line 337 of file predict.c.
References GEN_INT, INTVAL, REG_BR_PRED, REG_BR_PROB, REG_BR_PROB_BASE, REG_NOTE_KIND, REG_NOTES, and XEXP.
| static bool last_basic_block_p | ( | basic_block | bb | ) | [static] |
Definition at line 1458 of file predict.c.
References EXIT_BLOCK_PTR, basic_block_def::next_bb, single_succ(), and single_succ_p().
| bool maybe_hot_bb_p | ( | basic_block | bb | ) |
Definition at line 121 of file predict.c.
References BB_FREQ_MAX, basic_block_def::count, flag_branch_probabilities, basic_block_def::frequency, and PARAM_VALUE.
| void predict_edge_def | ( | edge | e, | |
| enum br_predictor | predictor, | |||
| enum prediction | taken | |||
| ) |
Definition at line 322 of file predict.c.
References predictor_info::hitrate, int, predict_edge(), REG_BR_PROB_BASE, and TAKEN.
| static void predict_insn | ( | rtx | insn, | |
| enum br_predictor | predictor, | |||
| int | probability | |||
| ) | [static] |
Definition at line 224 of file predict.c.
References any_condjump_p(), flag_guess_branch_prob, gcc_assert, GEN_INT, gen_rtx_CONCAT, gen_rtx_EXPR_LIST, REG_BR_PRED, and REG_NOTES.
| void predict_insn_def | ( | rtx | insn, | |
| enum br_predictor | predictor, | |||
| enum prediction | taken | |||
| ) |
Definition at line 241 of file predict.c.
References predictor_info::hitrate, int, predict_insn(), REG_BR_PROB_BASE, and TAKEN.
Definition at line 637 of file predict.c.
References BB_END, build_int_cstu(), can_predict_insn_p(), niter_desc::const_iter, current_loops, edge::dest, find_edge(), find_simple_exit(), flow_bb_inside_loop_p(), FOR_EACH_EDGE, free(), get_loop_body(), get_loop_exit_edges(), loop::header, HITRATE, host_integerp(), HOST_WIDE_INT, i, niter_desc::in_edge, int, iv_analysis_loop_init(), loop::latch, loop_niter_by_eval(), max, tree_niter_desc::niter, niter_desc::niter, NULL, NULL_TREE, loops::num, NUM_FIXED_BLOCKS, loop::num_nodes, number_of_iterations_exit(), PARAM_VALUE, loops::parray, predict_edge(), predict_edge_def(), predicted_by_p(), REG_BR_PROB_BASE, scev_finalize(), scev_initialize(), niter_desc::simple_p, TAKEN, TREE_CODE, tree_int_cst_lt(), and tree_low_cst().
| static void predict_paths_leading_to | ( | basic_block | bb, | |
| int * | heads, | |||
| enum br_predictor | pred, | |||
| enum prediction | taken | |||
| ) | [static] |
Definition at line 1476 of file predict.c.
References BASIC_BLOCK, CDI_DOMINATORS, CDI_POST_DOMINATORS, edge::dest, dominated_by_p(), ENTRY_BLOCK, FOR_EACH_EDGE, get_immediate_dominator(), basic_block_def::index, last_basic_block, NUM_FIXED_BLOCKS, predict_edge_def(), and is::y.
| static bool probability_reliable_p | ( | int | prob | ) | [static] |
Definition at line 201 of file predict.c.
References HITRATE, PROFILE_GUESSED, and PROFILE_READ.
Referenced by br_prob_note_reliable_p(), and edge_probability_reliable_p().
| bool probably_cold_bb_p | ( | basic_block | bb | ) |
Definition at line 135 of file predict.c.
References BB_FREQ_MAX, basic_block_def::count, flag_branch_probabilities, basic_block_def::frequency, and PARAM_VALUE.
| bool probably_never_executed_bb_p | ( | basic_block | bb | ) |
Definition at line 148 of file predict.c.
References basic_block_def::count, and flag_branch_probabilities.
Definition at line 1556 of file predict.c.
References BASIC_BLOCK, bitmap_bit_p(), bitmap_clear_bit(), BLOCK_INFO, count, edge::dest, dump_file, EDGE_DFS_BACK, EDGE_INFO, EXECUTE_IF_SET_IN_BITMAP, find_edge(), edge::flags, FOR_EACH_EDGE, fprintf(), frequency, gcc_assert, loop::header, i, basic_block_def::index, last, memcpy, NULL, edge::src, sreal_add(), sreal_compare(), sreal_div(), sreal_init(), sreal_mul(), sreal_sub(), and tmp.
| static enum br_predictor return_prediction | ( | tree | val, | |
| enum prediction * | prediction | |||
| ) | [static] |
Definition at line 1150 of file predict.c.
References integer_onep(), integer_zerop(), INTEGRAL_TYPE_P, NOT_TAKEN, POINTER_TYPE_P, TAKEN, TREE_CODE, TREE_CONSTANT, tree_int_cst_sgn(), and TREE_TYPE.
| void rtl_predict_edge | ( | edge | e, | |
| enum br_predictor | predictor, | |||
| int | probability | |||
| ) |
Definition at line 255 of file predict.c.
References any_condjump_p(), BB_END, EDGE_FALLTHRU, edge::flags, last_insn, predict_insn(), REG_BR_PROB_BASE, and edge::src.
| bool rtl_predicted_by_p | ( | basic_block | bb, | |
| enum br_predictor | predictor | |||
| ) |
Definition at line 159 of file predict.c.
References BB_END, INSN_P, int, INTVAL, REG_BR_PRED, REG_NOTE_KIND, REG_NOTES, and XEXP.
| static void set_even_probabilities | ( | basic_block | bb | ) | [static] |
Definition at line 387 of file predict.c.
References EDGE_EH, EDGE_FAKE, edge::flags, FOR_EACH_EDGE, and REG_BR_PROB_BASE.
Definition at line 1002 of file predict.c.
References bsi_end_p(), bsi_next(), bsi_start(), bsi_stmt(), BUILT_IN_NORMAL, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE, FOR_EACH_BB, get_callee_fndecl(), TREE_CHAIN, TREE_CODE, TREE_OPERAND, TREE_VALUE, and update_stmt().
Definition at line 1248 of file predict.c.
References apply_return_prediction(), bsi_end_p(), bsi_last(), bsi_next(), bsi_start(), bsi_stmt(), call_expr_flags(), ECF_NORETURN, ENTRY_BLOCK, ENTRY_BLOCK_PTR, FOR_EACH_BB, free(), heads, last_basic_block, memset, NOT_TAKEN, predict_paths_leading_to(), TREE_CODE, TREE_OPERAND, and XNEWVEC.
| static unsigned int tree_estimate_probability | ( | void | ) | [static] |
Definition at line 1292 of file predict.c.
References add_noreturn_fake_exit_edges(), bsi_end_p(), bsi_next(), bsi_start(), bsi_stmt(), calculate_dominance_info(), CDI_DOMINATORS, CDI_POST_DOMINATORS, combine_predictions_for_bb(), connect_infinite_loops_to_exit(), edge::dest, dominated_by_p(), dump_file, dump_flags, dump_tree_cfg(), estimate_bb_frequencies(), EXIT_BLOCK_PTR, flow_loops_dump(), flow_loops_find(), flow_loops_free(), FOR_EACH_BB, FOR_EACH_EDGE, free_dominance_info(), last_basic_block_p(), last_stmt(), mark_irreducible_loops(), NOT_TAKEN, NULL, predict_edge_def(), predict_loops(), predicted_by_p(), PROFILE_ABSENT, PROFILE_GUESSED, remove_fake_exit_edges(), single_pred_p(), edge::src, strip_builtin_expect(), TDF_DETAILS, tree_bb_level_predictions(), TREE_CODE, TREE_OPERAND, tree_predict_by_opcode(), and TREE_SIDE_EFFECTS.
| static void tree_predict_by_opcode | ( | basic_block | bb | ) | [static] |
Definition at line 1031 of file predict.c.
References BITMAP_ALLOC, BITMAP_FREE, COMPARISON_CLASS_P, cond, EDGE_TRUE_VALUE, expr_expected_value(), edge::flags, FLOAT_TYPE_P, FOR_EACH_EDGE, integer_all_onesp(), integer_onep(), integer_zerop(), last_stmt(), NOT_TAKEN, NULL, POINTER_TYPE_P, predict_edge_def(), real_minus_onep(), real_onep(), real_zerop(), TAKEN, TREE_CODE, TREE_OPERAND, TREE_TYPE, val, and visited.
| void tree_predict_edge | ( | edge | e, | |
| enum br_predictor | predictor, | |||
| int | probability | |||
| ) |
Definition at line 274 of file predict.c.
References bb_ann(), EDGE_COUNT, ENTRY_BLOCK_PTR, flag_guess_branch_prob, gcc_assert, ggc_alloc, i, optimize, PROFILE_GUESSED, and edge::src.
| bool tree_predicted_by_p | ( | basic_block | bb, | |
| enum br_predictor | predictor | |||
| ) |
Initial value:
{
"profile",
gate_estimate_probability,
tree_estimate_probability,
NULL,
NULL,
0,
TV_BRANCH_PROB,
PROP_cfg,
0,
0,
0,
TODO_ggc_collect | TODO_verify_ssa,
0
}
struct predictor_info predictor_info[] [static] |
sreal real_almost_one [static] |
sreal real_bb_freq_max [static] |
sreal real_br_prob_base [static] |
sreal real_inv_br_prob_base [static] |
sreal real_one_half [static] |
1.5.6