#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"

Go to the source code of this file.
| #define DUPLICATION_THRESHOLD 100 |
| #define gen_return | ( | ) | NULL_RTX |
Definition at line 96 of file bb-reorder.c.
| #define HAVE_return 0 |
Definition at line 95 of file bb-reorder.c.
| #define N_ROUNDS 5 |
Definition at line 1364 of file bb-reorder.c.
References BB_END, block_label(), edge::dest, dest, EDGE_COUNT, 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, src, edge::src, and unlink_insn_chain().
Referenced by fix_edges_for_rarely_executed_code().
Definition at line 1852 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.
Referenced by fix_edges_for_rarely_executed_code().
Definition at line 1247 of file bb-reorder.c.
References BB_COLD_PARTITION, BB_PARTITION, FOR_EACH_BB, and mark_bb_for_unlikely_executed_section().
Referenced by reorder_basic_blocks().
| static fibheapkey_t bb_to_key | ( | basic_block | bb | ) | [static] |
Definition at line 812 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.
Referenced by find_traces(), and find_traces_1_round().
| 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 852 of file bb-reorder.c.
References edge::dest, EDGE_CROSSING, and edge::flags.
Referenced by find_traces_1_round().
Definition at line 900 of file bb-reorder.c.
References BB_COLD_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, 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 xcalloc().
Referenced by reorder_basic_blocks().
| static basic_block copy_bb | ( | basic_block | old_bb, | |
| edge | e, | |||
| basic_block | bb, | |||
| int | trace | |||
| ) | [static] |
Definition at line 763 of file bb-reorder.c.
References array_size, 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, 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().
Referenced by connect_traces(), copy_cfg_body(), find_traces_1_round(), and rotate_loop().
| static bool copy_bb_p | ( | basic_block | bb, | |
| int | code_may_grow | |||
| ) | [static] |
Definition at line 1189 of file bb-reorder.c.
References can_duplicate_block_p(), dump_file, EDGE_COUNT, FOR_BB_INSNS, fprintf(), basic_block_def::frequency, get_attr_length(), basic_block_def::index, insn, INSN_P, max_size, maybe_hot_bb_p(), size, and uncond_jump_length.
Referenced by connect_traces(), find_traces_1_round(), and rotate_loop().
Definition at line 2011 of file bb-reorder.c.
References 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(), dest, duplicate_block(), EDGE_COMPLEX, EDGE_COUNT, EDGE_SUCC, EXIT_BLOCK_PTR, find_reg_note(), edge::flags, FOR_BB_INSNS, FOR_EACH_BB, FOR_EACH_EDGE, get_attr_length(), get_uncond_jump_length(), basic_block_def::index, insn, INSN_P, max_size, n_basic_blocks, basic_block_def::next_bb, NULL, NULL_RTX, PARAM_VALUE, size, targetm, timevar_pop, timevar_push, and uncond_jump_length.
Referenced by rest_of_compilation().
| static basic_block find_jump_block | ( | basic_block | jump_dest | ) | [static] |
Definition at line 1566 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.
Referenced by fix_crossing_conditional_branches().
| static void find_rarely_executed_basic_blocks_and_crossing_edges | ( | edge * | crossing_edges, | |
| int * | n_crossing_edges, | |||
| int * | max_idx | |||
| ) | [static] |
Definition at line 1263 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, gcc_target::have_named_sections, i, probably_never_executed_bb_p(), edge::src, targetm, and xrealloc().
Referenced by partition_hot_cold_basic_blocks().
Definition at line 227 of file bb-reorder.c.
References 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().
Referenced by reorder_basic_blocks().
| 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 435 of file bb-reorder.c.
References BB_COLD_PARTITION, BB_PARTITION, bb_to_key(), better_edge_p(), block_ends_with_call_p(), copy_bb(), copy_bb_p(), count, edge::dest, dump_file, EDGE_CAN_FALLTHRU, EDGE_COMPLEX, EDGE_COUNT, EDGE_CROSSING, EDGE_FAKE, EDGE_FREQUENCY, EDGE_SUCC, 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, basic_block_def::index, INT_MIN, fibnode::key, trace::last, trace::length, mark_bb_visited(), N_ROUNDS, bbro_basic_block_data_def::node, NULL, optimize_size, push_to_next_round_p(), rotate_loop(), trace::round, and bbro_basic_block_data_def::start_of_trace.
Referenced by find_traces().
Definition at line 1611 of file bb-reorder.c.
References ALLOC_REG_SET, any_condjump_p(), BB_COPY_PARTITION, BB_END, BB_HEAD, block_label(), COPY_REG_SET, create_basic_block(), edge::dest, 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.
Referenced by fix_edges_for_rarely_executed_code().
Definition at line 1771 of file bb-reorder.c.
References any_condjump_p(), BB_END, BLOCK_FOR_INSN, computed_jump_p(), delete_insn(), 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().
Referenced by fix_edges_for_rarely_executed_code().
| static void fix_edges_for_rarely_executed_code | ( | edge * | crossing_edges, | |
| int | n_crossing_edges | |||
| ) | [static] |
Definition at line 1900 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, gcc_target::have_named_sections, max_reg_num(), reg_scan(), and targetm.
Referenced by partition_hot_cold_basic_blocks().
Definition at line 1424 of file bb-reorder.c.
References 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, unlink_insn_chain(), and update_br_prob_note().
Referenced by fix_edges_for_rarely_executed_code().
| static int get_uncond_jump_length | ( | void | ) | [static] |
Definition at line 1231 of file bb-reorder.c.
References delete_insn(), emit_jump_insn(), emit_label_before(), gen_jump(), gen_label_rtx(), get_attr_length(), get_insns(), jump, and length.
Referenced by duplicate_computed_gotos(), and reorder_basic_blocks().
| static void mark_bb_for_unlikely_executed_section | ( | basic_block | bb | ) | [static] |
Definition at line 1331 of file bb-reorder.c.
References BB_END, BB_HEAD, emit_note_after(), gcc_assert, GET_CODE, NEXT_INSN, NOTE_BASIC_BLOCK, NOTE_INSN_BASIC_BLOCK, NOTE_LINE_NUMBER, and NULL.
Referenced by add_unlikely_executed_notes().
| static void mark_bb_visited | ( | basic_block | bb, | |
| int | trace | |||
| ) | [static] |
Definition at line 415 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.
Referenced by find_traces_1_round().
Definition at line 2180 of file bb-reorder.c.
References 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, and xcalloc().
Referenced by rest_of_handle_partition_blocks().
| 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 193 of file bb-reorder.c.
References BB_COLD_PARTITION, BB_PARTITION, basic_block_def::count, basic_block_def::frequency, and probably_never_executed_bb_p().
Referenced by find_traces_1_round().
| void reorder_basic_blocks | ( | unsigned int | flags | ) |
Definition at line 1950 of file bb-reorder.c.
| static basic_block rotate_loop | ( | edge | back_edge, | |
| struct trace * | trace, | |||
| int | trace_n | |||
| ) | [static] |
Definition at line 297 of file bb-reorder.c.
References any_condjump_p(), BB_END, copy_bb(), copy_bb_p(), edge::dest, EDGE_CAN_FALLTHRU, EDGE_COMPLEX, EDGE_COUNT, EDGE_FREQUENCY, EDGE_SUCC, EXIT_BLOCK_PTR, find_reg_note(), trace::first, edge::flags, FOR_EACH_EDGE, NULL, NULL_RTX, edge::src, and bbro_basic_block_data_def::start_of_trace.
Referenced by find_traces_1_round().
int array_size [static] |
Definition at line 130 of file bb-reorder.c.
Referenced by check_format_arg(), copy_bb(), DEFUN(), demangle_array_type(), estimate_niter_from_size_of_data(), ffestc_R501_item(), ffestc_R524_item(), ffestc_R547_item_object(), reorder_basic_blocks(), and AGGINIT::Traverse_Aggregate_Struct().
bbro_basic_block_data* bbd [static] |
Definition at line 133 of file bb-reorder.c.
int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0} [static] |
int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0} [static] |
int uncond_jump_length [static] |
Definition at line 111 of file bb-reorder.c.
Referenced by copy_bb_p(), duplicate_computed_gotos(), and reorder_basic_blocks().
1.5.6