GCC Middle and Back End API Reference
|
Data Structures | |
struct | htab_bb_copy_original_entry |
struct | bb_copy_hasher |
Variables | |
static struct obstack | block_aux_obstack |
static void * | first_block_aux_obj = 0 |
static struct obstack | edge_aux_obstack |
static void * | first_edge_aux_obj = 0 |
static hash_table< bb_copy_hasher > | bb_original |
static hash_table< bb_copy_hasher > | bb_copy |
static hash_table< bb_copy_hasher > | loop_copy |
static alloc_pool | original_copy_bb_pool |
|
static |
Allocate a memory block of SIZE as BB->aux. The obstack must be first initialized by alloc_aux_for_blocks.
References basic_block_def::aux, block_aux_obstack, and memset().
Referenced by alloc_aux_for_blocks().
void alloc_aux_for_blocks | ( | ) |
Initialize the block_aux_obstack and if SIZE is nonzero, call alloc_aux_for_block for each basic block.
References alloc_aux_for_block(), block_aux_obstack, and initialized.
void alloc_aux_for_edge | ( | ) |
Allocate a memory edge of SIZE as E->aux. The obstack must be first initialized by alloc_aux_for_edges.
References edge_def::aux, edge_aux_obstack, and memset().
void alloc_aux_for_edges | ( | ) |
Initialize the edge_aux_obstack and if SIZE is nonzero, call alloc_aux_for_edge for each basic edge.
References alloc_aux_for_edge(), edge_aux_obstack, initialized, and basic_block_def::succs.
basic_block alloc_block | ( | void | ) |
Allocate memory for basic_block.
Referenced by create_basic_block_structure(), create_bb(), and make_new_block().
void brief_dump_cfg | ( | ) |
Dumps a brief description of cfg to FILE.
References dump_bb_info().
edge cached_make_edge | ( | ) |
Create an edge connecting SRC and DST with FLAGS optionally using edge cache CACHE. Return the new edge, NULL if already exist.
References bitmap_bit_p(), bitmap_set_bit(), find_edge(), edge_def::flags, basic_block_def::index, make_edge(), and unchecked_make_edge().
|
static |
Check the consistency of profile information. We can't do that in verify_flow_info, as the counts may get invalid for incompletely solved graphs, later eliminating of conditionals or roundoff errors. It is still practical to have them reported for debugging of simple testcases.
References edge_def::count, basic_block_def::count, current_function_decl, basic_block_def::frequency, indent, memset(), basic_block_def::preds, edge_def::probability, PROFILE_ABSENT, and basic_block_def::succs.
Referenced by dump_bb_info().
void clear_aux_for_blocks | ( | void | ) |
Clear AUX pointers of all blocks.
References basic_block_def::aux.
Referenced by compute_antinout_edge(), compute_available(), convert_regs(), find_comparisons(), find_spanning_tree(), free_aux_for_blocks(), get_non_trapping(), if_convert(), partition_hot_cold_basic_blocks(), and reorder_loops().
void clear_aux_for_edges | ( | void | ) |
Clear AUX pointers of all edges.
References edge_def::aux, and basic_block_def::succs.
Referenced by compute_antinout_edge(), compute_available(), compute_laterin(), compute_nearerout(), free_aux_for_edges(), and optimize_mode_switching().
void clear_bb_flags | ( | void | ) |
Clear all basic block flags that do not have to be preserved.
References basic_block_def::flags.
Referenced by combine_instructions(), duplicate_computed_gotos(), and try_optimize_cfg().
void clear_edges | ( | void | ) |
Free the memory associated with the edge structures.
References free_edge(), basic_block_def::preds, basic_block_def::succs, and vec_safe_truncate().
Referenced by release_function_body().
void compact_blocks | ( | void | ) |
Sequentially order blocks and compact the arrays.
References df, df_compact_blocks(), and basic_block_def::index.
Referenced by analyze_function(), branch_prob(), cleanup_cfg(), cleanup_tree_cfg_noloop(), and relink_block_chain().
|
inlinestatic |
Connect E to E->dest.
References edge_def::dest, edge_def::dest_idx, df_mark_solutions_dirty(), basic_block_def::preds, and vec_safe_push().
Referenced by redirect_edge_succ(), and unchecked_make_edge().
|
inlinestatic |
Connect E to E->src.
References df_mark_solutions_dirty(), edge_def::src, basic_block_def::succs, and vec_safe_push().
Referenced by redirect_edge_pred(), and unchecked_make_edge().
|
static |
Removes the value associated with OBJ from table TAB.
References hash_table< Descriptor, Allocator >::clear_slot(), hash_table< Descriptor, Allocator >::find_slot(), htab_bb_copy_original_entry::index1, and pool_free().
Referenced by set_loop_copy().
|
static |
Sets the value associated with OBJ in table TAB to VAL. Do nothing when data structures are not initialized.
References hash_table< Descriptor, Allocator >::find_slot(), htab_bb_copy_original_entry::index1, and pool_alloc().
Referenced by set_bb_copy(), set_bb_original(), and set_loop_copy().
DEBUG_FUNCTION void debug | ( | ) |
References dump_edge_info().
DEBUG_FUNCTION void debug_bb | ( | ) |
References dump_bb(), and dump_flags.
DEBUG_FUNCTION basic_block debug_bb_n | ( | ) |
References debug_bb().
|
inlinestatic |
Disconnect edge E from E->dest.
References edge_def::dest, edge_def::dest_idx, df_mark_solutions_dirty(), and basic_block_def::preds.
Referenced by redirect_edge_succ(), and remove_edge_raw().
|
inlinestatic |
Disconnect edge E from E->src.
References df_mark_solutions_dirty(), ei_next(), ei_safe_edge(), edge_iterator::index, edge_def::src, and basic_block_def::succs.
Referenced by redirect_edge_pred(), and remove_edge_raw().
void dump_bb_info | ( | FILE * | outf, |
basic_block | bb, | ||
int | indent, | ||
int | flags, | ||
bool | do_header, | ||
bool | do_footer | ||
) |
Dumps cfg related information about basic block BB to OUTF. If HEADER is true, dump things that appear before the instructions contained in BB. If FOOTER is true, dump things that appear after. Flags are the TDF_* masks as documented in dumpfile.h. NB: With TDF_DETAILS, it is assumed that cfun is available, so that maybe_hot_bb_p and probably_never_executed_bb_p don't ICE.
References bb_loop_depth(), check_bb_profile(), basic_block_def::count, current_function_decl, dump_edge_info(), first, basic_block_def::flags, basic_block_def::frequency, HOST_WIDEST_INT, HOST_WIDEST_INT_PRINT_DEC, indent, basic_block_def::index, maybe_hot_bb_p(), memset(), basic_block_def::next_bb, basic_block_def::preds, basic_block_def::prev_bb, probably_never_executed_bb_p(), and basic_block_def::succs.
Referenced by brief_dump_cfg(), dump_bb(), and print_rtl_with_bb().
void dump_edge_info | ( | ) |
void expunge_block | ( | ) |
Remove block B from the basic block array.
References basic_block_def::index, and unlink_block().
void free_aux_for_blocks | ( | void | ) |
Free data allocated in block_aux_obstack and clear AUX pointers of all blocks.
References block_aux_obstack, and clear_aux_for_blocks().
Referenced by compute_branch_probabilities(), delete_worklist(), estimate_bb_frequencies(), fini_pre(), one_code_hoisting_pass(), reg_to_stack(), and vt_finalize().
void free_aux_for_edges | ( | void | ) |
Free data allocated in edge_aux_obstack and clear AUX pointers of all edges.
References clear_aux_for_edges(), and edge_aux_obstack.
Referenced by branch_prob(), estimate_bb_frequencies(), and tree_ssa_lim_finalize().
|
static |
Helper function for remove_edge and clear_edges. Frees edge structure without actually removing it from the pred/succ arrays.
References ggc_free().
Referenced by clear_edges(), and remove_edge_raw().
void free_original_copy_tables | ( | void | ) |
Free the data structures to maintain mapping between blocks and its copies.
References hash_table< Descriptor, Allocator >::dispose(), and free_alloc_pool().
Referenced by copy_loop_before(), gen_parallel_loop(), gimple_duplicate_sese_region(), gimple_duplicate_sese_tail(), graphite_finalize(), ipa_tm_execute(), relink_block_chain(), tail_duplicate(), thread_through_all_blocks(), tree_predictive_commoning(), tree_ssa_prefetch_arrays(), tree_unswitch_single_loop(), try_unroll_loop_completely(), vect_do_peeling_for_alignment(), vect_do_peeling_for_loop_bound(), and vect_loop_versioning().
basic_block get_bb_copy | ( | ) |
Get the copy of basic block.
References hash_table< Descriptor, Allocator >::find(), basic_block_def::index, htab_bb_copy_original_entry::index1, and htab_bb_copy_original_entry::index2.
basic_block get_bb_original | ( | ) |
Get the original basic block.
References hash_table< Descriptor, Allocator >::find(), basic_block_def::index, htab_bb_copy_original_entry::index1, and htab_bb_copy_original_entry::index2.
|
read |
Get the copy of LOOP.
References cfun, hash_table< Descriptor, Allocator >::find(), get_loop(), htab_bb_copy_original_entry::index1, htab_bb_copy_original_entry::index2, and loop::num.
void init_flow | ( | ) |
Called once at initialization time.
void initialize_original_copy_tables | ( | void | ) |
Initialize the data structures to maintain mapping between blocks and its copies.
References hash_table< Descriptor, Allocator >::create(), and create_alloc_pool().
Referenced by cfg_layout_initialize(), copy_loop_before(), gen_parallel_loop(), gimple_duplicate_sese_region(), gimple_duplicate_sese_tail(), graphite_initialize(), ipa_tm_execute(), relink_block_chain(), tail_duplicate(), thread_through_all_blocks(), tree_predictive_commoning(), tree_ssa_prefetch_arrays(), tree_unswitch_single_loop(), try_unroll_loop_completely(), vect_do_peeling_for_alignment(), vect_do_peeling_for_loop_bound(), and vect_loop_versioning().
void link_block | ( | ) |
Link block B to chain after AFTER.
References basic_block_def::next_bb, and basic_block_def::prev_bb.
edge make_edge | ( | ) |
Create an edge connecting SRC and DEST with flags FLAGS. Return newly created edge or NULL if already exist.
References find_edge(), edge_def::flags, and unchecked_make_edge().
edge make_single_succ_edge | ( | ) |
Create an edge connecting SRC to DEST and set probability by knowing that it is the single edge leaving SRC.
References edge_def::count, basic_block_def::count, make_edge(), and edge_def::probability.
void redirect_edge_pred | ( | ) |
Redirect an edge's predecessor from one block to another.
References connect_src(), disconnect_src(), and edge_def::src.
void redirect_edge_succ | ( | ) |
Redirect an edge's successor from one block to another.
References connect_dest(), edge_def::dest, disconnect_dest(), execute_on_growing_pred(), and execute_on_shrinking_pred().
void remove_edge_raw | ( | ) |
This function will remove an edge from the flow graph.
References disconnect_dest(), disconnect_src(), execute_on_shrinking_pred(), free_edge(), and remove_predictions_associated_with_edge().
void scale_bbs_frequencies_gcov_type | ( | basic_block * | bbs, |
int | nbbs, | ||
gcov_type | num, | ||
gcov_type | den | ||
) |
Multiply all frequencies of basic blocks in array BBS of length NBBS by NUM/DEN, in gcov_type arithmetic. More accurate than previous function but considerably slower.
References count, edge_def::count, basic_block_def::count, frequency, and basic_block_def::frequency.
Referenced by gimple_duplicate_sese_region(), and gimple_duplicate_sese_tail().
void scale_bbs_frequencies_int | ( | ) |
Multiply all frequencies of basic blocks in array BBS of length NBBS by NUM/DEN, in int arithmetic. May lose some accuracy.
References count, edge_def::count, basic_block_def::count, frequency, and basic_block_def::frequency.
void set_bb_copy | ( | ) |
Set copy for basic block. Do nothing when data structures are not initialized so passes not needing this don't need to care.
References copy_original_table_set(), and basic_block_def::index.
void set_bb_original | ( | ) |
Set original for basic block. Do nothing when data structures are not initialized so passes not needing this don't need to care.
References copy_original_table_set(), and basic_block_def::index.
void set_loop_copy | ( | ) |
Set copy for LOOP to COPY. Do nothing when data structures are not initialized so passes not needing this don't need to care.
References copy_original_table_clear(), copy_original_table_set(), and loop::num.
edge unchecked_make_edge | ( | ) |
Create an edge connecting SRC and DEST with flags FLAGS. Return newly created edge. Use this only if you are sure that this edge can't possibly already exist.
References connect_dest(), connect_src(), edge_def::dest, execute_on_growing_pred(), edge_def::flags, and edge_def::src.
void unlink_block | ( | ) |
Unlink block B from chain.
References basic_block_def::next_bb, and basic_block_def::prev_bb.
void update_bb_profile_for_threading | ( | basic_block | bb, |
int | edge_frequency, | ||
gcov_type | count, | ||
edge | taken_edge | ||
) |
An edge originally destinating BB of FREQUENCY and COUNT has been proved to leave the block by TAKEN_EDGE. Update profile of BB such that edge E can be redirected to destination of TAKEN_EDGE. This function may leave the profile inconsistent in the case TAKEN_EDGE frequency or count is believed to be lower than FREQUENCY or COUNT respectively.
References count, edge_def::count, basic_block_def::count, edge_def::dest, dump_file, ei_next(), ei_safe_edge(), basic_block_def::frequency, basic_block_def::index, prob, edge_def::probability, edge_def::src, and basic_block_def::succs.
Referenced by thread_block(), thread_single_edge(), and try_forward_edges().
|
static |
Referenced by add_phi_args_after_copy_edge().
|
static |
Data structures used to maintain mapping between basic blocks and copies.
|
static |
Simple routines to easily allocate AUX fields of basic blocks.
Referenced by alloc_aux_for_block(), alloc_aux_for_blocks(), and free_aux_for_blocks().
|
static |
Referenced by alloc_aux_for_edge(), alloc_aux_for_edges(), and free_aux_for_edges().
|
static |
|
static |
|
static |
And between loops and copies.
|
static |