#include "config.h"#include "system.h"#include "coretypes.h"#include "tm.h"#include "rtl.h"#include "regs.h"#include "flags.h"#include "timevar.h"#include "output.h"#include "cfglayout.h"#include "fibheap.h"#include "target.h"#include "function.h"#include "tm_p.h"#include "obstack.h"#include "expr.h"#include "params.h"#include "toplev.h"#include "tree-pass.h"

Go to the source code of this file.
| #define DUPLICATION_THRESHOLD 100 |
Definition at line 114 of file bb-reorder.c.
| #define gen_return | ( | ) | NULL_RTX |
Definition at line 102 of file bb-reorder.c.
Definition at line 146 of file bb-reorder.c.
| #define HAVE_conditional_execution 0 |
Definition at line 89 of file bb-reorder.c.
| #define HAVE_return 0 |
Definition at line 101 of file bb-reorder.c.
| #define N_ROUNDS 5 |
Definition at line 95 of file bb-reorder.c.
Definition at line 1273 of file bb-reorder.c.
References BB_END, block_label(), dest, edge::dest, EDGE_FALLTHRU, emit_barrier_after(), emit_jump_insn_after(), ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, edge::flags, gcc_assert, gen_jump(), i, JUMP_LABEL, JUMP_P, LABEL_NUSES, single_succ_p(), src, edge::src, and unlink_insn_chain().
Definition at line 1766 of file bb-reorder.c.
References BB_END, EDGE_CROSSING, edge::flags, FOR_EACH_BB, FOR_EACH_EDGE, gen_rtx_EXPR_LIST, JUMP_P, NULL_RTX, REG_NOTES, and edge::src.
| static fibheapkey_t bb_to_key | ( | basic_block | bb | ) | [static] |
Definition at line 809 of file bb-reorder.c.
References BB_COLD_PARTITION, BB_FREQ_MAX, BB_PARTITION, EDGE_DFS_BACK, EDGE_FREQUENCY, bbro_basic_block_data_def::end_of_trace, ENTRY_BLOCK_PTR, edge::flags, FOR_EACH_EDGE, basic_block_def::frequency, probably_never_executed_bb_p(), and edge::src.
| static bool better_edge_p | ( | basic_block | bb, | |
| edge | e, | |||
| int | prob, | |||
| int | freq, | |||
| int | best_prob, | |||
| int | best_freq, | |||
| edge | cur_best_edge | |||
| ) | [static] |
Definition at line 897 of file bb-reorder.c.
References basic_block_def::aux, BB_COLD_PARTITION, BB_HOT_PARTITION, BB_PARTITION, copy_bb(), copy_bb_p(), edge::dest, di, dump_file, DUPLICATION_THRESHOLD, EDGE_CAN_FALLTHRU, EDGE_COMPLEX, EDGE_FREQUENCY, bbro_basic_block_data_def::end_of_trace, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, fflush(), first, trace::first, edge::flags, FOR_EACH_EDGE, fprintf(), fputc(), FREE, gcc_assert, i, basic_block_def::index, INT_MAX, trace::last, last, trace::length, max_entry_count, max_entry_frequency, NULL, optimize_size, si, edge::src, bbro_basic_block_data_def::start_of_trace, t2, and XCNEWVEC.
| static basic_block copy_bb | ( | basic_block | old_bb, | |
| edge | e, | |||
| basic_block | bb, | |||
| int | trace | |||
| ) | [static] |
Definition at line 757 of file bb-reorder.c.
References array_size, basic_block_def::aux, BB_COPY_PARTITION, edge::dest, dump_file, duplicate_block(), bbro_basic_block_data_def::end_of_trace, fprintf(), gcc_assert, GET_ARRAY_SIZE, bbro_basic_block_data_def::heap, i, bbro_basic_block_data_def::in_trace, basic_block_def::index, last_basic_block, MAX, bbro_basic_block_data_def::node, NULL, bbro_basic_block_data_def::start_of_trace, and xrealloc().
| static bool copy_bb_p | ( | basic_block | bb, | |
| int | code_may_grow | |||
| ) | [static] |
Definition at line 1158 of file bb-reorder.c.
References can_duplicate_block_p(), dump_file, EDGE_COUNT, FOR_BB_INSNS, fprintf(), basic_block_def::frequency, get_attr_min_length(), basic_block_def::index, insn, INSN_P, max_size, maybe_hot_bb_p(), PARAM_VALUE, size, and uncond_jump_length.
| static unsigned int duplicate_computed_gotos | ( | void | ) | [static] |
Definition at line 1983 of file bb-reorder.c.
References basic_block_def::aux, BB_END, BITMAP_ALLOC, bitmap_bit_p(), bitmap_empty_p, BITMAP_FREE, bitmap_set_bit(), can_duplicate_block_p(), gcc_target::cannot_modify_jumps_p, cfg_layout_finalize(), cfg_layout_initialize(), computed_jump_p(), duplicate_block(), EDGE_COMPLEX, EXIT_BLOCK_PTR, find_reg_note(), edge::flags, FOR_BB_INSNS, FOR_EACH_BB, FOR_EACH_EDGE, get_attr_min_length(), get_uncond_jump_length(), index(), basic_block_def::index, insn, INSN_P, max_size, n_basic_blocks, basic_block_def::next_bb, NULL, NULL_RTX, NUM_FIXED_BLOCKS, PARAM_VALUE, single_pred_p(), single_succ(), single_succ_edge(), single_succ_p(), size, targetm, and uncond_jump_length.
| static basic_block find_jump_block | ( | basic_block | jump_dest | ) | [static] |
Definition at line 1475 of file bb-reorder.c.
References any_condjump_p(), BB_END, BB_HEAD, EDGE_CROSSING, edge::flags, FOR_EACH_EDGE, insn, INSN_P, JUMP_P, LABEL_P, NEXT_INSN, NULL, src, and edge::src.
| static void find_rarely_executed_basic_blocks_and_crossing_edges | ( | edge * | crossing_edges, | |
| int * | n_crossing_edges, | |||
| int * | max_idx | |||
| ) | [static] |
Definition at line 1220 of file bb-reorder.c.
References BB_COLD_PARTITION, BB_HOT_PARTITION, BB_PARTITION, BB_SET_PARTITION, edge::dest, EDGE_CROSSING, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, edge::flags, FOR_EACH_BB, FOR_EACH_EDGE, i, probably_never_executed_bb_p(), edge::src, and xrealloc().
Definition at line 224 of file bb-reorder.c.
References basic_block_def::aux, bb_to_key(), branch_threshold, edge::dest, dump_file, ENTRY_BLOCK_PTR, exec_threshold, fflush(), fibheap_delete(), fibheap_insert(), fibheap_new(), find_traces_1_round(), first, FOR_EACH_EDGE, fprintf(), basic_block_def::frequency, bbro_basic_block_data_def::heap, i, basic_block_def::index, INT_MAX, trace::last, max_entry_count, max_entry_frequency, N_ROUNDS, bbro_basic_block_data_def::node, REG_BR_PROB_BASE, and round().
| static void find_traces_1_round | ( | int | branch_th, | |
| int | exec_th, | |||
| gcov_type | count_th, | |||
| struct trace * | traces, | |||
| int * | n_traces, | |||
| int | round, | |||
| fibheap_t * | heap, | |||
| int | number_of_rounds | |||
| ) | [static] |
Definition at line 428 of file bb-reorder.c.
References basic_block_def::aux, BB_PARTITION, bb_to_key(), better_edge_p(), block_ends_with_call_p(), copy_bb(), copy_bb_p(), edge::dest, dump_file, EDGE_CAN_FALLTHRU, EDGE_COMPLEX, EDGE_COUNT, EDGE_CROSSING, EDGE_FAKE, EDGE_FREQUENCY, bbro_basic_block_data_def::end_of_trace, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, fibheap_delete(), fibheap_empty(), fibheap_extract_min(), fibheap_insert(), fibheap_new(), fibheap_replace_key(), trace::first, edge::flags, FOR_EACH_EDGE, fprintf(), gcc_assert, bbro_basic_block_data_def::heap, bbro_basic_block_data_def::in_trace, basic_block_def::index, INT_MIN, fibnode::key, trace::last, trace::length, mark_bb_visited(), bbro_basic_block_data_def::node, NULL, optimize_size, push_to_next_round_p(), rotate_loop(), trace::round, single_pred_p(), single_succ(), single_succ_edge(), single_succ_p(), and bbro_basic_block_data_def::start_of_trace.
Definition at line 1520 of file bb-reorder.c.
References ALLOC_REG_SET, any_condjump_p(), basic_block_def::aux, BB_COPY_PARTITION, BB_END, BB_HEAD, block_label(), COPY_REG_SET, create_basic_block(), dest, edge::dest, EDGE_COUNT, EDGE_CROSSING, EDGE_SUCC, emit_barrier_after(), emit_jump_insn_after(), emit_label_before(), EXIT_BLOCK_PTR, find_jump_block(), edge::flags, FOR_EACH_BB, gcc_assert, gen_jump(), gen_label_rtx(), gen_return, GET_CODE, basic_block_def::global_live_at_end, basic_block_def::global_live_at_start, HAVE_return, JUMP_LABEL, last_bb, make_edge(), new_label, NULL, NULL_RTX, old_label, PATTERN, PC, redirect_edge_succ(), redirect_jump(), reg_obstack, RETURN, SET, SET_SRC, unlink_insn_chain(), XEXP, and XVECEXP.
Definition at line 1680 of file bb-reorder.c.
References any_condjump_p(), BARRIER_P, BB_END, BLOCK_FOR_INSN, computed_jump_p(), delete_insn(), EDGE_COUNT, EDGE_CROSSING, EDGE_SUCC, emit_indirect_jump(), emit_insn_before(), emit_move_insn(), end_sequence(), edge::flags, FOR_EACH_BB, gcc_assert, gen_reg_rtx(), gen_rtx_LABEL_REF, get_insns(), JUMP_LABEL, JUMP_P, LABEL_NUSES, last_insn, NEXT_INSN, NULL_RTX, Pmode, start_sequence(), and tablejump_p().
| static void fix_edges_for_rarely_executed_code | ( | edge * | crossing_edges, | |
| int | n_crossing_edges | |||
| ) | [static] |
Definition at line 1814 of file bb-reorder.c.
References add_labels_and_missing_jumps(), add_reg_crossing_jump_notes(), fix_crossing_conditional_branches(), fix_crossing_unconditional_branches(), fix_up_fall_thru_edges(), get_insns(), HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH, max_reg_num(), and reg_scan().
Definition at line 1333 of file bb-reorder.c.
References basic_block_def::aux, BB_COPY_PARTITION, BB_END, block_label(), edge::dest, EDGE_COUNT, EDGE_CROSSING, EDGE_FALLTHRU, EDGE_SUCC, emit_barrier_after(), EXIT_BLOCK_PTR, edge::flags, FOR_EACH_BB, force_nonfallthru(), invert_jump(), NULL, single_succ_edge(), unlink_insn_chain(), and update_br_prob_note().
Definition at line 1976 of file bb-reorder.c.
References flag_expensive_optimizations, optimize, and optimize_size.
Definition at line 2259 of file bb-reorder.c.
References current_function_decl, DECL_ONE_ONLY, and user_defined_section_attribute.
| static int get_uncond_jump_length | ( | void | ) | [static] |
Definition at line 1200 of file bb-reorder.c.
References delete_insn(), emit_jump_insn(), emit_label_before(), gen_jump(), gen_label_rtx(), get_attr_min_length(), get_insns(), jump, and length.
Definition at line 1949 of file bb-reorder.c.
References BB_HEAD, BB_PARTITION, emit_note_before(), and FOR_EACH_BB.
Referenced by rest_of_handle_reorder_blocks().
| static void mark_bb_visited | ( | basic_block | bb, | |
| int | trace | |||
| ) | [static] |
Definition at line 408 of file bb-reorder.c.
References fibheap_delete_node(), bbro_basic_block_data_def::heap, basic_block_def::index, bbro_basic_block_data_def::node, and NULL.
Definition at line 2166 of file bb-reorder.c.
References basic_block_def::aux, cfg_layout_finalize(), cfg_layout_initialize(), find_rarely_executed_basic_blocks_and_crossing_edges(), fix_edges_for_rarely_executed_code(), FOR_EACH_BB, free(), basic_block_def::index, last_basic_block, n_basic_blocks, basic_block_def::next_bb, NUM_FIXED_BLOCKS, and XCNEWVEC.
| static bool push_to_next_round_p | ( | basic_block | bb, | |
| int | round, | |||
| int | number_of_rounds, | |||
| int | exec_th, | |||
| gcov_type | count_th | |||
| ) | [static] |
Definition at line 200 of file bb-reorder.c.
References basic_block_def::count, basic_block_def::frequency, and probably_never_executed_bb_p().
| void reorder_basic_blocks | ( | unsigned int | flags | ) |
Definition at line 1891 of file bb-reorder.c.
References add_unlikely_executed_notes(), array_size, gcc_target::cannot_modify_jumps_p, cfg_layout_finalize(), cfg_layout_initialize(), connect_traces(), dump_file, dump_flags, dump_flow_info(), bbro_basic_block_data_def::end_of_trace, find_traces(), FREE, GET_ARRAY_SIZE, get_uncond_jump_length(), gcc_target::have_named_sections, bbro_basic_block_data_def::heap, i, bbro_basic_block_data_def::in_trace, last_basic_block, mark_dfs_back_edges(), n_basic_blocks, bbro_basic_block_data_def::node, NULL, NUM_FIXED_BLOCKS, set_edge_can_fallthru_flag(), bbro_basic_block_data_def::start_of_trace, targetm, timevar_pop, timevar_push, uncond_jump_length, verify_hot_cold_block_grouping(), xmalloc(), and XNEWVEC.
| static unsigned int rest_of_handle_partition_blocks | ( | void | ) | [static] |
Definition at line 2273 of file bb-reorder.c.
References allocate_reg_life_data(), no_new_pseudos, NULL, partition_hot_cold_basic_blocks(), PROP_DEATH_NOTES, PROP_LOG_LINKS, PROP_REG_INFO, UPDATE_LIFE_GLOBAL_RM_NOTES, and update_life_info().
| static unsigned int rest_of_handle_reorder_blocks | ( | void | ) | [static] |
Definition at line 2206 of file bb-reorder.c.
References changed, cleanup_cfg(), CLEANUP_EXPENSIVE, CLEANUP_UPDATE_LIFE, flag_reorder_blocks, flag_schedule_insns_after_reload, HAVE_conditional_execution, insert_section_boundary_note(), NULL, PROP_DEATH_NOTES, reorder_basic_blocks(), timevar_pop, timevar_push, tracer(), UPDATE_LIFE_GLOBAL_RM_NOTES, and update_life_info().
| static basic_block rotate_loop | ( | edge | back_edge, | |
| struct trace * | trace, | |||
| int | trace_n | |||
| ) | [static] |
Definition at line 292 of file bb-reorder.c.
References any_condjump_p(), basic_block_def::aux, BB_END, copy_bb(), copy_bb_p(), edge::dest, EDGE_CAN_FALLTHRU, EDGE_COMPLEX, EDGE_FREQUENCY, EXIT_BLOCK_PTR, find_reg_note(), trace::first, edge::flags, FOR_EACH_EDGE, NULL, NULL_RTX, single_succ(), single_succ_edge(), single_succ_p(), edge::src, and bbro_basic_block_data_def::start_of_trace.
Definition at line 1857 of file bb-reorder.c.
References BB_PARTITION, err, error(), FOR_EACH_BB, gcc_assert, and basic_block_def::index.
Referenced by reorder_basic_blocks().
int array_size [static] |
Definition at line 139 of file bb-reorder.c.
bbro_basic_block_data* bbd [static] |
Definition at line 142 of file bb-reorder.c.
int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0} [static] |
Definition at line 107 of file bb-reorder.c.
int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0} [static] |
Definition at line 110 of file bb-reorder.c.
gcov_type max_entry_count [static] |
Definition at line 166 of file bb-reorder.c.
int max_entry_frequency [static] |
Definition at line 165 of file bb-reorder.c.
Initial value:
{
"compgotos",
gate_duplicate_computed_gotos,
duplicate_computed_gotos,
NULL,
NULL,
0,
TV_REORDER_BLOCKS,
0,
0,
0,
0,
TODO_dump_func,
0
}
Definition at line 2089 of file bb-reorder.c.
Referenced by init_optimization_passes().
Initial value:
{
"bbpart",
gate_handle_partition_blocks,
rest_of_handle_partition_blocks,
NULL,
NULL,
0,
TV_REORDER_BLOCKS,
0,
0,
0,
0,
TODO_dump_func,
0
}
Definition at line 2284 of file bb-reorder.c.
Referenced by init_optimization_passes().
Initial value:
{
"bbro",
gate_handle_reorder_blocks,
rest_of_handle_reorder_blocks,
NULL,
NULL,
0,
TV_REORDER_BLOCKS,
0,
0,
0,
0,
TODO_dump_func,
'B'
}
Definition at line 2241 of file bb-reorder.c.
Referenced by init_optimization_passes().
int uncond_jump_length [static] |
Definition at line 117 of file bb-reorder.c.
1.5.6