GCC Middle and Back End API Reference
|
Data Structures | |
struct | predictor_info |
struct | edge_prediction |
struct | block_info_def |
struct | edge_info_def |
Typedefs | |
typedef struct block_info_def * | block_info |
typedef struct edge_info_def * | edge_info |
Variables | |
static sreal | real_zero |
static sreal | real_one |
static sreal | real_almost_one |
static sreal | real_br_prob_base |
static sreal | real_inv_br_prob_base |
static sreal | real_one_half |
static sreal | real_bb_freq_max |
static struct predictor_info | predictor_info [] |
static gcov_type | min_count = -1 |
static struct pointer_map_t * | bb_predictions |
typedef struct block_info_def * block_info |
This is used to carry information about basic blocks. It is attached to the AUX field of the standard CFG block.
typedef struct edge_info_def * edge_info |
Similar information for edges.
|
static |
Find the basic block with return expression and look up for possible return value trying to apply RETURN_PREDICTION heuristics.
References gimple_phi_arg_edge(), gimple_phi_num_args(), gimple_return_retval(), last_stmt(), predict_paths_leading_to_edge(), return_prediction(), and edge_def::src.
Referenced by tree_bb_level_predictions().
|
static |
Callback for pointer_map_traverse, asserts that the pointer map is empty.
Referenced by tree_estimate_probability().
|
static |
Attempt to predict probabilities of BB outgoing edges using local properties.
References can_predict_insn_p(), get_condition(), NOT_TAKEN, predict_insn_def(), and TAKEN.
Referenced by guess_outgoing_edge_probabilities().
bool br_prob_note_reliable_p | ( | ) |
Same predicate as edge_probability_reliable_p, working on notes.
References probability_reliable_p().
tree build_predict_expr | ( | ) |
Build PREDICT_EXPR.
References build_int_cst().
|
static |
Referenced by bb_estimate_probability_locally(), and combine_predictions_for_insn().
|
static |
Return true when we can store prediction on insn INSN. At the moment we represent predictions only on conditional jumps, not at computed jump or other complicated cases.
References any_condjump_p().
bool cgraph_maybe_hot_edge_p | ( | ) |
Return true if the call can be hot.
References cgraph_edge::callee, cgraph_edge::caller, cgraph_edge::count, cgraph_edge::frequency, maybe_hot_count_p(), NODE_FREQUENCY_EXECUTED_ONCE, NODE_FREQUENCY_HOT, NODE_FREQUENCY_UNLIKELY_EXECUTED, and profile_info.
bool cgraph_optimize_for_size_p | ( | ) |
Return true if NODE should be optimized for size.
References NODE_FREQUENCY_UNLIKELY_EXECUTED.
|
static |
Clears the list of predictions stored for BB.
References edge_prediction::ep_next, free(), and pointer_map_contains().
Referenced by combine_predictions_for_bb().
|
static |
Combine predictions into single probability and store them into CFG. Remove now useless prediction entries.
References clear_bb_predictions(), basic_block_def::count, dump_file, dump_prediction(), END_PREDICTORS, edge_prediction::ep_edge, edge_prediction::ep_next, edge_prediction::ep_predictor, edge_prediction::ep_probability, first, edge_def::flags, basic_block_def::index, pointer_map_contains(), prob, edge_def::probability, set_even_probabilities(), and basic_block_def::succs.
Referenced by tree_estimate_probability().
|
static |
Referenced by guess_outgoing_edge_probabilities().
|
static |
Combine all REG_BR_PRED notes into single probability and attach REG_BR_PROB note if not already present. Remove now useless REG_BR_PRED notes.
References add_reg_note(), can_predict_insn_p(), dump_file, dump_prediction(), END_PREDICTORS, find_reg_note(), basic_block_def::index, prob, edge_def::probability, set_even_probabilities(), single_succ_edge(), and single_succ_p().
void compute_function_frequency | ( | void | ) |
Decide whether function is hot, cold or unlikely executed.
References cfun, cgraph_get_node(), current_function_decl, flags_from_decl_or_type(), lookup_attribute(), maybe_hot_bb_p(), NODE_FREQUENCY_EXECUTED_ONCE, NODE_FREQUENCY_HOT, NODE_FREQUENCY_NORMAL, NODE_FREQUENCY_UNLIKELY_EXECUTED, cgraph_node::only_called_at_exit, cgraph_node::only_called_at_startup, probably_never_executed_bb_p(), and profile_info.
Referenced by compute_branch_probabilities(), estimate_bb_frequencies(), and execute_fixup_cfg().
int counts_to_freqs | ( | void | ) |
Convert counts measured by profile driven feedback to frequencies. Return nonzero iff there was any nonzero execution count.
References basic_block_def::count, and basic_block_def::frequency.
Referenced by compute_branch_probabilities(), estimate_bb_frequencies(), gimple_value_profile_transformations(), and rebuild_frequencies().
void default_rtl_profile | ( | void | ) |
Set RTL expansion to default mode (i.e. when profile info is not known).
Referenced by combine_instructions(), computation_cost(), gimple_expand_cfg(), gimplify_body(), init_expmed(), init_set_costs(), optimize_mode_switching(), peephole2_optimize(), prepare_function_start(), split_all_insns(), and thread_prologue_and_epilogue_insns().
|
static |
Dump information about the branch prediction to the output file.
References edge_def::count, basic_block_def::count, edge_def::flags, HOST_WIDEST_INT_PRINT_DEC, and basic_block_def::succs.
Referenced by combine_predictions_for_bb(), and combine_predictions_for_insn().
bool edge_probability_reliable_p | ( | ) |
Same predicate as above, working on edges.
References edge_def::probability, and probability_reliable_p().
void estimate_bb_frequencies | ( | void | ) |
Estimate basic blocks frequency by given branch probabilities.
References alloc_aux_for_blocks(), alloc_aux_for_edges(), compute_function_frequency(), counts_to_freqs(), estimate_loops(), free_aux_for_blocks(), free_aux_for_edges(), frequency, basic_block_def::frequency, mark_dfs_back_edges(), memcpy(), edge_def::probability, PROFILE_READ, single_succ_edge(), sreal_add(), sreal_compare(), sreal_div(), sreal_init(), sreal_mul(), sreal_sub(), sreal_to_int(), and basic_block_def::succs.
Referenced by rebuild_frequencies(), and tree_estimate_probability().
|
static |
Propagates frequencies through structure of loops.
References bitmap_set_bit(), cfun, estimate_loops_at_level(), basic_block_def::index, number_of_loops(), and propagate_freq().
Referenced by estimate_bb_frequencies().
|
static |
Estimate probabilities of loopback edges in loops at same nest level.
References bitmap_set_bit(), free(), get_loop_body(), loop::header, loop::inner, loop_latch_edge(), loop::next, loop::num_nodes, and propagate_freq().
Referenced by estimate_loops().
bool expensive_function_p | ( | ) |
Return true if function is likely to be expensive, so there is no point to optimize performance of prologue, epilogue or do inlining at the expense of code size growth. THRESHOLD is the limit of number of instructions function can execute at average to be still considered not expensive.
References active_insn_p(), basic_block_def::frequency, and limit.
|
static |
Compare two SSA_NAMEs: returns TRUE if T1 and T2 are value coherent.
References is_gimple_assign().
Referenced by predict_iv_comparison().
Referenced by expr_expected_value_1().
|
static |
Return constant EXPR will likely have at execution time, NULL if unknown. The function is used by builtin_expect branch predictor so the evidence must come from this construct and additional possible constant folding. We may want to implement more involved value guess (such as value range propagation based prediction), but such tricks shall go to new implementation.
References expr_expected_value_1(), and extract_ops_from_tree().
|
static |
Helper function for expr_expected_value.
References bitmap_set_bit(), BUILT_IN_NORMAL, expr_expected_value(), get_gimple_rhs_class(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_call_arg(), gimple_call_fndecl(), gimple_call_num_args(), gimple_phi_num_args(), GIMPLE_SINGLE_RHS, GIMPLE_UNARY_RHS, is_gimple_assign(), is_gimple_call(), and operand_equal_p().
Referenced by expr_expected_value(), and tree_predict_by_opcode().
|
static |
|
static |
Return the SSA_NAME in T or T's operands. Return NULL if SSA_NAME cannot be found.
References strips_small_constant().
Referenced by is_comparison_with_loop_invariant_p().
gcov_type get_hot_bb_threshold | ( | void | ) |
Determine the threshold for hot BB counts.
References find_working_set(), min_count, and gcov_working_set_info::min_counter.
Referenced by ipa_profile(), maybe_hot_count_p(), and output_profile_summary().
void gimple_predict_edge | ( | ) |
Predict edge E with the given PROBABILITY.
References edge_prediction::ep_edge, edge_prediction::ep_next, edge_prediction::ep_predictor, edge_prediction::ep_probability, pointer_map_insert(), PROFILE_GUESSED, edge_def::src, and basic_block_def::succs.
bool gimple_predicted_by_p | ( | ) |
Return true if the one of outgoing edges is already predicted by PREDICTOR.
References edge_prediction::ep_next, edge_prediction::ep_predictor, and pointer_map_contains().
void guess_outgoing_edge_probabilities | ( | ) |
Set edge->probability for each successor edge of BB.
References bb_estimate_probability_locally(), and combine_predictions_for_insn().
void invert_br_probabilities | ( | ) |
Invert all branch predictions or probability notes in the INSN. This needs to be done each time we invert the condition used by the jump.
Referenced by redirect_jump_2().
|
static |
Check the compare STMT in LOOP. If it compares an induction variable to a loop invariant, return true, and save LOOP_INVARIANT, COMPARE_CODE and LOOP_STEP. Otherwise return false and set LOOP_INVAIANT to NULL.
References affine_iv::base, get_base_value(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), host_integerp(), integer_zerop(), invert_tree_comparison(), loop_containing_stmt(), simple_iv(), and affine_iv::step.
Referenced by predict_iv_comparison(), and predict_loops().
gimple_opt_pass* make_pass_profile | ( | ) |
gimple_opt_pass* make_pass_strip_predict_hints | ( | ) |
bool maybe_hot_bb_p | ( | ) |
Return true in case BB can be CPU intensive and should be optimized for maximal performance.
References basic_block_def::count, basic_block_def::frequency, maybe_hot_count_p(), maybe_hot_frequency_p(), and PROFILE_READ.
|
inlinestatic |
Return TRUE if frequency FREQ is considered to be hot.
References get_hot_bb_threshold(), profile_info, PROFILE_READ, and gcov_ctr_summary::runs.
Referenced by cgraph_maybe_hot_edge_p(), maybe_hot_bb_p(), and maybe_hot_edge_p().
bool maybe_hot_edge_p | ( | ) |
Return true in case BB can be CPU intensive and should be optimized for maximal performance.
References cfun, edge_def::count, maybe_hot_count_p(), maybe_hot_frequency_p(), and PROFILE_READ.
|
inlinestatic |
Return TRUE if frequency FREQ is considered to be hot.
References cgraph_get_node(), frequency, NODE_FREQUENCY_EXECUTED_ONCE, NODE_FREQUENCY_HOT, NODE_FREQUENCY_UNLIKELY_EXECUTED, PROFILE_ABSENT, and profile_info.
Referenced by maybe_hot_bb_p(), and maybe_hot_edge_p().
bool optimize_bb_for_size_p | ( | ) |
Return TRUE when BB should be optimized for size.
References cfun, maybe_hot_bb_p(), and optimize_function_for_size_p().
bool optimize_bb_for_speed_p | ( | ) |
Return TRUE when BB should be optimized for speed.
References optimize_bb_for_size_p().
bool optimize_edge_for_size_p | ( | ) |
Return TRUE when BB should be optimized for size.
References cfun, maybe_hot_edge_p(), and optimize_function_for_size_p().
bool optimize_edge_for_speed_p | ( | ) |
Return TRUE when BB should be optimized for speed.
References optimize_edge_for_size_p().
bool optimize_function_for_size_p | ( | ) |
Return true when current function should always be optimized for size.
References cgraph_get_node(), and cgraph_optimize_for_size_p().
bool optimize_function_for_speed_p | ( | ) |
Return true when current function should always be optimized for speed.
References optimize_function_for_size_p().
bool optimize_insn_for_size_p | ( | void | ) |
Return TRUE when BB should be optimized for size.
References cfun, and optimize_function_for_size_p().
Referenced by expand_builtin_mathfn(), expand_builtin_mathfn_2(), expand_switch_as_decision_tree_p(), and optimize_insn_for_speed_p().
bool optimize_insn_for_speed_p | ( | void | ) |
Return TRUE when BB should be optimized for speed.
References optimize_insn_for_size_p().
Referenced by avoid_expensive_constant(), choose_mult_variant(), compress_float_constant(), do_jump(), emit_case_dispatch_table(), emit_store_flag(), expand_abs_nojump(), expand_binop(), expand_divmod(), expand_gimple_cond(), expand_mult(), expand_one_cmpl_abs_nojump(), expand_sdiv_pow2(), expand_shift_1(), expand_smod_pow2(), expand_widening_mult(), expmed_mult_highpart(), expmed_mult_highpart_optab(), fold_builtin_strcat(), gimple_expand_builtin_pow(), lshift_cheap_p(), precompute_register_parameters(), prefer_and_bit_test(), prepare_cmp_insn(), and synth_mult().
bool optimize_loop_for_size_p | ( | ) |
Return TRUE when LOOP should be optimized for size.
References loop::header, and optimize_bb_for_size_p().
bool optimize_loop_for_speed_p | ( | ) |
Return TRUE when LOOP should be optimized for speed.
References loop::header, and optimize_bb_for_speed_p().
bool optimize_loop_nest_for_size_p | ( | ) |
Return TRUE when LOOP nest should be optimized for size.
References optimize_loop_nest_for_speed_p().
bool optimize_loop_nest_for_speed_p | ( | ) |
Return TRUE when LOOP nest should be optimized for speed.
References loop::inner, loop_outer(), loop::next, and optimize_loop_for_speed_p().
void predict_edge_def | ( | edge | e, |
enum br_predictor | predictor, | ||
enum prediction | taken | ||
) |
Predict edge E by given predictor if possible.
References predict_edge(), and TAKEN.
Referenced by predict_iv_comparison(), predict_loops(), predict_paths_for_bb(), predict_paths_leading_to_edge(), tree_estimate_probability_bb(), and tree_predict_by_opcode().
|
static |
Predict for extra loop exits that will lead to EXIT_EDGE. The extra loop exits are resulted from short-circuit conditions that will generate an if_tmp. E.g.: if (foo() || global > 10) break; This will be translated into: BB3: loop header... BB4: if foo() goto BB6 else goto BB5 BB5: if global > 10 goto BB6 else goto BB7 BB6: goto BB7 BB7: iftmp = (PHI 0(BB5), 1(BB6)) if iftmp == 1 goto BB8 else goto BB3 BB8: outside of the loop... The edge BB7->BB8 is loop exit because BB8 is outside of the loop. From the dataflow, we can infer that BB4->BB6 and BB5->BB6 are also loop exits. This function takes BB7->BB8 as input, and finds out the extra loop exits to predict them using PRED_LOOP_EXIT.
References edge_def::flags, gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_phi_arg_def(), gimple_phi_arg_edge(), gimple_phi_num_args(), integer_onep(), integer_zerop(), last_stmt(), NOT_TAKEN, predict_paths_leading_to_edge(), basic_block_def::preds, edge_def::src, and basic_block_def::succs.
Referenced by predict_loops().
|
static |
References add_reg_note(), and any_condjump_p().
Referenced by predict_insn_def(), and rtl_predict_edge().
void predict_insn_def | ( | rtx | insn, |
enum br_predictor | predictor, | ||
enum prediction | taken | ||
) |
Predict insn by given predictor.
References predict_insn(), and TAKEN.
Referenced by bb_estimate_probability_locally(), and stack_protect_epilogue().
|
static |
Predict branch probability of BB when BB contains a branch that compares an induction variable in LOOP with LOOP_IV_BASE_VAR to LOOP_BOUND_VAR. The loop exit is compared using LOOP_BOUND_CODE, with step of LOOP_BOUND_STEP. E.g. for (int i = 0; i < bound; i++) { if (i < bound - 2) computation_1(); else computation_2(); } In this loop, we will predict the branch inside the loop to be taken.
References double_int::arshift(), clz_hwi(), double_int::divmod(), double_int::divmod_with_overflow(), expr_coherent_p(), edge_def::flags, double_int::from_shwi(), double_int::high, host_integerp(), is_comparison_with_loop_invariant_p(), double_int::is_negative(), double_int::is_zero(), last_stmt(), double_int::mul_with_sign(), NOT_TAKEN, predict_edge(), predict_edge_def(), predicted_by_p(), double_int::scmp(), double_int::sub_with_overflow(), basic_block_def::succs, TAKEN, double_int::to_uhwi(), and tree_to_double_int().
Referenced by predict_loops().
|
static |
Predict edge probabilities by exploiting loop structure.
References loop::bounds, compare_tree_int(), edge_def::dest, estimated_stmt_executions_int(), loop::exits, find_edge(), flow_bb_inside_loop_p(), free(), get_loop_body(), get_loop_exit_edges(), loop::header, host_integerp(), HOST_WIDE_INT, basic_block_def::index, is_comparison_with_loop_invariant_p(), last_stmt(), loop::latch, loop_niter_by_eval(), nb_iter_bound::next, tree_niter_desc::niter, loop::num_nodes, number_of_iterations_exit(), predict_edge(), predict_edge_def(), predict_extra_loop_exits(), predict_iv_comparison(), predicted_by_p(), nb_iter_bound::stmt, basic_block_def::succs, TAKEN, and tree_low_cst().
Referenced by tree_estimate_probability().
|
static |
Predict edges to successors of CUR whose sources are not postdominated by BB by PRED and recurse to all postdominators.
References bitmap_set_bit(), CDI_POST_DOMINATORS, edge_def::dest, dominated_by_p(), first_dom_son(), edge_def::flags, basic_block_def::index, next_dom_son(), predict_edge_def(), basic_block_def::preds, edge_def::src, and basic_block_def::succs.
Referenced by predict_paths_leading_to(), and predict_paths_leading_to_edge().
|
static |
Sets branch probabilities according to PREDiction and FLAGS.
References predict_paths_for_bb(), and visited.
Referenced by tree_bb_level_predictions().
|
static |
Like predict_paths_leading_to but take edge instead of basic block.
References CDI_POST_DOMINATORS, edge_def::dest, dominated_by_p(), edge_def::flags, predict_edge_def(), predict_paths_for_bb(), edge_def::src, basic_block_def::succs, and visited.
Referenced by apply_return_prediction(), and predict_extra_loop_exits().
bool predictable_edge_p | ( | ) |
Return true when edge E is likely to be well predictable by branch predictor.
References edge_def::probability, and PROFILE_ABSENT.
const char* predictor_name | ( | ) |
References predictor_info::name.
Referenced by dump_generic_node(), and pp_gimple_stmt_1().
|
static |
Return true when the probability of edge is reliable. The profile guessing code is good at predicting branch outcome (ie. taken/not taken), that is predicted right slightly over 75% of time. It is however notoriously poor on predicting the probability itself. In general the profile appear a lot flatter (with probabilities closer to 50%) than the reality so it is bad idea to use it to drive optimization such as those disabling dynamic branch prediction for well predictable branches. There are two exceptions - edges leading to noreturn edges and edges predicted by number of iterations heuristics are predicted well. This macro should be able to distinguish those, but at the moment it simply check for noreturn heuristic that is only one giving probability over 99% or bellow 1%. In future we might want to propagate reliability information across the CFG if we find this information useful on multiple places.
References PROFILE_GUESSED, and PROFILE_READ.
Referenced by br_prob_note_reliable_p(), and edge_probability_reliable_p().
bool probably_never_executed_bb_p | ( | ) |
Return true in case BB is probably never executed.
References cgraph_get_node(), basic_block_def::count, NODE_FREQUENCY_UNLIKELY_EXECUTED, profile_info, and gcov_ctr_summary::runs.
|
static |
Helper function for estimate_bb_frequencies. Propagate the frequencies in blocks marked in TOVISIT, starting in HEAD.
References bitmap_bit_p(), bitmap_clear_bit(), count, basic_block_def::count, edge_def::dest, dump_file, find_edge(), edge_def::flags, frequency, basic_block_def::frequency, basic_block_def::index, last, memcpy(), basic_block_def::preds, edge_def::probability, edge_def::src, sreal_add(), sreal_compare(), sreal_div(), sreal_init(), sreal_mul(), sreal_sub(), and basic_block_def::succs.
Referenced by estimate_loops(), and estimate_loops_at_level().
void rebuild_frequencies | ( | void | ) |
Rebuild function frequencies. Passes are in general expected to maintain profile by hand, however in some cases this is not possible: for example when inlining several functions with loops freuqencies might run out of scale and thus needs to be recomputed.
References add_noreturn_fake_exit_edges(), connect_infinite_loops_to_exit(), counts_to_freqs(), estimate_bb_frequencies(), loop_optimizer_finalize(), loop_optimizer_init(), mark_irreducible_loops(), PROFILE_GUESSED, PROFILE_READ, remove_fake_exit_edges(), timevar_pop(), and timevar_push().
Referenced by execute_function_todo(), and tree_function_versioning().
void remove_predictions_associated_with_edge | ( | ) |
Remove all predictions on given basic block that are attached to edge E.
References edge_prediction::ep_next, free(), pointer_map_contains(), and edge_def::src.
|
static |
Try to guess whether the value of return means error code.
References integer_onep(), integer_zerop(), NOT_TAKEN, TAKEN, and tree_int_cst_sgn().
Referenced by apply_return_prediction().
void rtl_predict_edge | ( | ) |
Predict edge E with given probability if possible.
References any_condjump_p(), edge_def::flags, predict_insn(), and edge_def::src.
bool rtl_predicted_by_p | ( | ) |
Return true if the one of outgoing edges is already predicted by PREDICTOR.
void rtl_profile_for_bb | ( | ) |
Set RTL expansion for BB profile.
References cfun, and maybe_hot_bb_p().
void rtl_profile_for_edge | ( | ) |
Set RTL expansion for edge profile.
References maybe_hot_edge_p().
|
static |
We can not predict the probabilities of outgoing edges of bb. Set them evenly and hope for the best.
References edge_def::flags, edge_def::probability, and basic_block_def::succs.
Referenced by combine_predictions_for_bb(), and combine_predictions_for_insn().
void set_hot_bb_threshold | ( | ) |
Set the threshold for hot BB counts.
References min_count.
Referenced by input_profile_summary(), and ipa_profile().
|
static |
Get rid of all builtin_expect calls and GIMPLE_PREDICT statements we no longer need.
References BUILT_IN_NORMAL, gimple_call_arg(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_num_args(), gsi_end_p(), gsi_next(), gsi_remove(), gsi_replace(), gsi_start_bb(), gsi_stmt(), and nb_iter_bound::stmt.
|
static |
Check if T1 and T2 satisfy the IV_COMPARE condition. Return the SSA_NAME if the condition satisfies, NULL otherwise. T1 and T2 should be one of the following cases: 1. T1 is SSA_NAME, T2 is NULL 2. T1 is SSA_NAME, T2 is INTEGER_CST between [-4, 4] 3. T2 is SSA_NAME, T1 is INTEGER_CST between [-4, 4]
References host_integerp(), and tree_low_cst().
Referenced by get_base_value().
|
static |
Look for basic block that contains unlikely to happen events (such as noreturn calls) and mark all paths leading to execution of this basic blocks as unlikely.
References apply_return_prediction(), edge_def::flags, gimple_call_flags(), gimple_call_fndecl(), gimple_predict_outcome(), gimple_predict_predictor(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_call(), lookup_attribute(), NOT_TAKEN, predict_paths_leading_to(), and nb_iter_bound::stmt.
Referenced by tree_estimate_probability().
void tree_estimate_probability | ( | void | ) |
Predict branch probabilities and estimate profile of the tree CFG. This function can be called from the loop optimizers to recompute the profile information.
References add_noreturn_fake_exit_edges(), assert_is_empty(), calculate_dominance_info(), CDI_POST_DOMINATORS, cfun, combine_predictions_for_bb(), connect_infinite_loops_to_exit(), CP_SIMPLE_PREHEADERS, create_preheaders(), estimate_bb_frequencies(), free_dominance_info(), number_of_loops(), pointer_map_create(), pointer_map_destroy(), pointer_map_traverse(), predict_loops(), record_loop_exits(), remove_fake_exit_edges(), tree_bb_level_predictions(), and tree_estimate_probability_bb().
Referenced by graphite_finalize(), and tree_estimate_probability_driver().
|
static |
Predict branch probabilities and estimate profile for basic block BB.
References CDI_DOMINATORS, CDI_POST_DOMINATORS, edge_def::dest, dominated_by_p(), gimple_has_side_effects(), gimple_label_label(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_call(), last, last_stmt(), lookup_attribute(), basic_block_def::next_bb, NOT_TAKEN, predict_edge_def(), predicted_by_p(), basic_block_def::preds, single_succ_edge(), single_succ_p(), edge_def::src, nb_iter_bound::stmt, basic_block_def::succs, TAKEN, and tree_predict_by_opcode().
Referenced by tree_estimate_probability().
|
static |
Predict branch probabilities and estimate profile of the tree CFG. This is the driver function for PASS_PROFILE.
References cfun, dump_file, dump_flags, flow_loops_dump(), gimple_dump_cfg(), loop_optimizer_finalize(), loop_optimizer_init(), mark_irreducible_loops(), number_of_loops(), PROFILE_ABSENT, PROFILE_GUESSED, scev_finalize(), scev_initialize(), and tree_estimate_probability().
|
static |
Predict using opcode of the last statement in basic block.
References expr_expected_value_1(), edge_def::flags, gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), integer_all_onesp(), integer_onep(), integer_zerop(), last_stmt(), NOT_TAKEN, predict_edge_def(), real_minus_onep(), real_onep(), real_zerop(), nb_iter_bound::stmt, basic_block_def::succs, TAKEN, type(), and visited.
Referenced by tree_estimate_probability_bb().
|
static |
This map contains for a basic block the list of predictions for the outgoing edges.
|
static |
Referenced by get_hot_bb_threshold(), and set_hot_bb_threshold().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Referenced by rewrite_reciprocal().
|
static |
|
static |
@verbatim Branch prediction routines for the GNU compiler.
Copyright (C) 2000-2013 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
References: [1] "Branch Prediction for Free" Ball and Larus; PLDI '93. [2] "Static Branch Frequency and Program Profile Analysis" Wu and Larus; MICRO-27. [3] "Corpus-based Static Branch Prediction" Calder, Grunwald, Lindsay, Martin, Mozer, and Zorn; PLDI '95.
real constants: 0, 1, 1-1/REG_BR_PROB_BASE, REG_BR_PROB_BASE, 1/REG_BR_PROB_BASE, 0.5, BB_FREQ_MAX.