GCC Middle and Back End API Reference
|
Variables | |
static bool | first_pass |
static bool | crossjumps_occured |
static bool | block_was_dirty |
|
static |
Returns true if BB basic block has a preserve label.
References block_label().
Referenced by try_crossjump_to_edge().
|
static |
Examine register notes on I1 and I2 and return: - dir_forward if I1 can be replaced by I2, or - dir_backward if I2 can be replaced by I1, or - dir_both if both are the case.
References d1, d2, dir_backward, dir_both, dir_forward, dir_none, equal_different_set_p(), find_reg_equal_equiv_note(), reload_completed, rtx_equal_p(), and rtx_renumbered_equal_p().
Referenced by old_insns_match_p().
bool cleanup_cfg | ( | ) |
Tidy the CFG by deleting unreachable code and whatnot.
References add_noreturn_fake_exit_edges(), calculate_dominance_info(), CDI_DOMINATORS, changed, compact_blocks(), crossjumps_occured, current_ir_type(), dbg_cnt(), delete_dead_jumptables(), delete_trivially_dead_insns(), delete_unreachable_blocks(), dom_info_available_p(), fix_loop_structure(), free_dominance_info(), get_insns(), IR_RTL_CFGLAYOUT, max_reg_num(), reload_completed, remove_fake_exit_edges(), run_fast_dce(), timevar_pop(), timevar_push(), and try_optimize_cfg().
void delete_dead_jumptables | ( | void | ) |
Delete any jump tables never referenced. We can't delete them at the time of removing tablejump insn as they are referenced by the preceding insns computing the destination, so we delay deleting and garbagecollect them once life information is computed.
References delete_insn(), and dump_file.
Referenced by cfg_layout_finalize(), and cleanup_cfg().
bool delete_unreachable_blocks | ( | void | ) |
Delete all unreachable basic blocks.
References CDI_DOMINATORS, changed, current_ir_type(), delete_basic_block(), dom_info_available_p(), find_unreachable_blocks(), first_dom_son(), basic_block_def::flags, get_all_dominated_blocks(), IR_GIMPLE, basic_block_def::prev_bb, and tidy_fallthru_edges().
Referenced by cleanup_cfg(), cleanup_tree_cfg_noloop(), delete_unmarked_insns(), execute_cleanup_eh_1(), execute_lower_eh_dispatch(), execute_rtl_cprop(), execute_rtl_hoist(), execute_rtl_pre(), execute_rtl_store_motion(), expand_thunk(), ira(), one_cprop_pass(), and tail_merge_optimize().
|
static |
References reload_completed, rtx_equal_p(), and rtx_renumbered_equal_p().
Referenced by can_replace_by().
|
static |
References cleanup_cfg(), delete_trivially_dead_insns(), dump_file, dump_flags, dump_flow_info(), get_insns(), and max_reg_num().
|
static |
References cleanup_cfg().
int flow_find_cross_jump | ( | basic_block | bb1, |
basic_block | bb2, | ||
rtx * | f1, | ||
rtx * | f2, | ||
enum replace_direction * | dir_p | ||
) |
Look through the insns at the end of BB1 and BB2 and find the longest sequence that are either equivalent, or allow forward or backward replacement. Store the first insns for that sequence in *F1 and *F2 and return the sequence length. DIR_P indicates the allowed replacement direction on function entry, and the actual replacement direction on function exit. If NULL, only equivalent sequences are allowed. To simplify callers of this function, if the blocks match exactly, store the head of the blocks in *F1 and *F2.
References cc0_rtx, dir_backward, dir_both, dir_forward, dir_none, i1, i2, merge_dir(), merge_memattrs(), merge_notes(), old_insns_match_p(), onlyjump_p(), reg_mentioned_p(), returnjump_p(), sets_cc0_p(), side_effects_p(), simplejump_p(), and walk_to_nondebug_insn().
Referenced by cond_exec_process_if_block(), and try_crossjump_to_edge().
int flow_find_head_matching_sequence | ( | basic_block | bb1, |
basic_block | bb2, | ||
rtx * | f1, | ||
rtx * | f2, | ||
int | stop_after | ||
) |
Like flow_find_cross_jump, except start looking for a matching sequence from the head of the two blocks. Do not include jumps at the end. If STOP_AFTER is nonzero, stop after finding that many matching instructions.
References cc0_rtx, dir_both, edge_def::flags, i1, i2, merge_memattrs(), merge_notes(), old_insns_match_p(), reg_mentioned_p(), sets_cc0_p(), and basic_block_def::succs.
Referenced by cond_exec_process_if_block(), and try_head_merge_bb().
rtl_opt_pass* make_pass_jump | ( | ) |
rtl_opt_pass* make_pass_jump2 | ( | ) |
Referenced by thread_jump().
|
static |
Attempt to prove that operation is NOOP using CSElib or mark the effect on register. Used by jump threading.
References bitmap_clear_bit(), bitmap_clear_range(), bitmap_set_bit(), bitmap_set_range(), pc_rtx, rtx_equal_for_cselib_p(), and SET.
|
static |
Referenced by thread_jump().
|
static |
Return nonzero if X is a register set in regset DATA. Called via for_each_rtx.
|
static |
Attempt to merge basic blocks that are potentially non-adjacent. Return NULL iff the attempt failed, otherwise return basic block where cleanup_cfg should continue. Because the merging commonly moves basic block away or introduces another optimization possibility, return basic block just before B so cleanup_cfg don't need to iterate. It may be good idea to return basic block before C in the case C has been moved after B and originally appeared earlier in the insn sequence, but we have no information available about the relative ordering of these two. Hopefully it is not too common.
References dump_file, find_fallthru_edge(), edge_def::flags, force_nonfallthru(), basic_block_def::index, loop::latch, basic_block_def::loop_father, merge_blocks(), merge_blocks_move_predecessor_nojumps(), merge_blocks_move_successor_nojumps(), basic_block_def::next_bb, notice_new_block(), basic_block_def::preds, basic_block_def::prev_bb, edge_def::src, basic_block_def::succs, and update_forwarder_flag().
Referenced by try_optimize_cfg().
|
static |
Referenced by merge_blocks_move().
|
static |
Blocks A and B are to be merged into a single block. A has no incoming fallthru edge, so it can be moved before B without adding or modifying any jumps (aside from the jump from A to B).
References delete_insn(), df_set_bb_dirty(), dump_file, basic_block_def::index, link_block(), merge_blocks(), next_nonnote_insn(), basic_block_def::prev_bb, reorder_insns_nobb(), and unlink_block().
|
static |
Referenced by merge_blocks_move().
|
static |
Blocks A and B are to be merged into a single block. B has no outgoing fallthru edge, so it can be moved after A without adding or modifying any jumps (aside from the jump from A to B).
References delete_insn(), dump_file, basic_block_def::index, merge_blocks(), prev_active_insn(), reorder_insns_nobb(), table, and tablejump_p().
|
static |
Referenced by flow_find_cross_jump(), flow_find_head_matching_sequence(), and merge_memattrs().
void merge_memattrs | ( | ) |
Removes the memory attributes of MEM expression if they are not equal.
References clear_mem_offset(), clear_mem_size(), HOST_WIDE_INT, mem_expr_equal_p(), merge_memattrs(), set_mem_alias_set(), set_mem_align(), set_mem_expr(), and set_mem_size().
|
static |
When comparing insns I1 and I2 in flow_find_cross_jump or flow_find_head_matching_sequence, ensure the notes match.
References find_reg_equal_equiv_note(), remove_note(), and rtx_equal_p().
Referenced by flow_find_cross_jump(), and flow_find_head_matching_sequence().
|
static |
Referenced by merge_blocks_move(), and try_forward_edges().
|
static |
Set flags for newly created block.
References basic_block_def::flags, and forwarder_block_p().
|
static |
Referenced by flow_find_cross_jump(), flow_find_head_matching_sequence(), and outgoing_edges_match().
|
static |
Examine I1 and I2 and return: - dir_forward if I1 can be replaced by I2, or - dir_backward if I2 can be replaced by I1, or - dir_both if both are the case.
References BUILT_IN_NORMAL, can_replace_by(), dir_both, dir_none, find_args_size_adjust(), find_reg_note(), get_call_rtx_from(), hard_reg_set_equal_p(), HOST_WIDE_INT_MIN, reload_completed, rtx_equal_p(), rtx_renumbered_equal_p(), and stack_regs_mentioned().
|
static |
Referenced by try_crossjump_to_edge().
|
static |
Return true iff outgoing edges of BB1 and BB2 match, together with the branch instruction. This means that if we commonize the control flow before end of the basic block, the semantic remains unchanged. We may assume that there exists one edge with a common destination.
References any_condjump_p(), d1, d2, edge_def::dest, dir_both, dump_file, f1, f2, find_reg_note(), edge_def::flags, for_each_rtx(), forwarder_block_p(), basic_block_def::index, edge_iterator::index, old_insns_match_p(), onlyjump_p(), optimize_bb_for_speed_p(), pc_rtx, pc_set(), prev_nondebug_insn(), edge_def::probability, replace_label_data::r1, replace_label_data::r2, replace_label(), reversed_comparison_code(), rtx_equal_p(), rtx_referenced_p(), rtx_renumbered_equal_p(), simplejump_p(), single_succ(), single_succ_edge(), single_succ_p(), basic_block_def::succs, swap_condition(), tablejump_p(), and replace_label_data::update_label_nuses.
|
static |
Referenced by try_forward_edges().
|
static |
Attempt to prove that the basic block B will have no side effects and always continues in the same edge if reached via E. Return the edge if exist, NULL otherwise.
References any_condjump_p(), comparison_dominates_p(), cselib_finish(), cselib_init(), cselib_process_insn(), edge_def::flags, basic_block_def::flags, for_each_rtx(), mark_effect(), mentions_nonequal_regs(), onlyjump_p(), pc_rtx, pc_set(), reversed_comparison_code(), rtx_equal_p(), side_effects_p(), edge_def::src, and basic_block_def::succs.
|
static |
Return true if BB contains just bb note, or bb note followed by only DEBUG_INSNs.
Referenced by try_optimize_cfg().
|
static |
Referenced by try_optimize_cfg().
|
static |
Search the predecessors of BB for common insn sequences. When found, share code between them by redirecting control flow. Return true if any changes made.
References changed, computed_jump_p(), crossjumps_occured, dir_both, dir_forward, find_fallthru_edge(), first_pass, basic_block_def::flags, basic_block_def::index, optimize_bb_for_size_p(), basic_block_def::preds, edge_def::src, and try_crossjump_to_edge().
|
static |
E1 and E2 are edges with the same destination block. Search their predecessors for common code. If found, redirect control flow from (maybe the middle of) E1->SRC to (maybe the middle of) E2->SRC (dir_forward), or the other way around (dir_backward). DIR specifies the allowed replacement direction.
References block_has_preserve_label(), edge_def::count, basic_block_def::count, d2, delete_basic_block(), edge_def::dest, df_set_bb_dirty(), dir_backward, dump_file, find_fallthru_edge(), edge_def::flags, flow_find_cross_jump(), for_each_rtx(), basic_block_def::frequency, get_insns(), basic_block_def::index, outgoing_edges_match(), basic_block_def::preds, edge_def::probability, replace_label_data::r1, replace_label_data::r2, redirect_edge_and_branch_force(), reload_completed, replace_label(), single_pred_edge(), single_pred_p(), single_succ(), single_succ_edge(), split_block(), edge_def::src, basic_block_def::succs, tablejump_p(), update_br_prob_note(), update_forwarder_flag(), and replace_label_data::update_label_nuses.
Referenced by try_crossjump_bb().
|
static |
Referenced by try_optimize_cfg().
|
static |
Attempt to forward edges leaving basic block B. Return true if successful.
References apply_probability(), changed, edge_def::count, basic_block_def::count, edge_def::dest, dump_file, ei_next(), ei_safe_edge(), find_reg_note(), first, first_pass, edge_def::flags, basic_block_def::flags, free(), basic_block_def::frequency, edge_def::goto_locus, basic_block_def::index, last, notice_new_block(), prev_nondebug_insn(), edge_def::probability, redirect_edge_and_branch(), redirect_edge_and_branch_force(), single_succ(), single_succ_edge(), single_succ_p(), edge_def::src, basic_block_def::succs, thread_jump(), threaded_edges, update_bb_profile_for_threading(), and update_br_prob_note().
|
static |
Search the successors of BB for common insn sequences. When found, share code between them by moving it across the basic block boundary. Return true if any changes made.
References block_was_dirty, can_move_insns_across(), cc0_rtx, changed, computed_jump_p(), control_flow_insn_p(), crossjumps_occured, delete_insn_chain(), edge_def::dest, df_get_bb_dirty(), df_set_bb_dirty(), df_simulate_one_insn_backwards(), find_reg_note(), edge_def::flags, flow_find_head_matching_sequence(), free(), get_condition(), live, optimize_bb_for_size_p(), basic_block_def::preds, prev_nonnote_nondebug_insn(), prev_real_insn(), reg_mentioned_p(), reorder_insns(), simulate_backwards_to_point(), edge_def::src, and basic_block_def::succs.
Referenced by try_optimize_cfg().
|
static |
Referenced by cleanup_cfg().
|
static |
Do simple CFG optimizations - basic block merging, simplifying of jump instructions etc. Return nonzero if changes were made.
References block_was_dirty, can_merge_blocks_p(), changed, clear_bb_flags(), crossjumps_occured, current_ir_type(), delete_basic_block(), delete_insn(), edge_def::dest, df_analyze(), dump_file, emit_barrier(), emit_barrier_after(), end_sequence(), find_reg_note(), first_pass, edge_def::flags, basic_block_def::flags, get_last_bb_insn(), basic_block_def::index, IR_RTL_CFGLAYOUT, label_is_jump_target_p(), last, merge_blocks(), merge_blocks_move(), basic_block_def::next_bb, onlyjump_p(), basic_block_def::preds, basic_block_def::prev_bb, redirect_edge_succ_nodup(), reload_completed, simplejump_p(), single_pred(), single_pred_edge(), single_pred_p(), single_succ(), single_succ_edge(), single_succ_p(), edge_def::src, start_sequence(), basic_block_def::succs, tablejump_p(), targetm, trivially_empty_bb_p(), try_crossjump_bb(), try_forward_edges(), try_head_merge_bb(), try_redirect_by_replacing_jump(), try_simplify_condjump(), update_forwarder_flag(), and verify_flow_info().
|
static |
Referenced by try_optimize_cfg().
|
static |
Simplify a conditional jump around an unconditional jump. Return true if something changed.
References any_condjump_p(), block_label(), can_fallthru(), delete_basic_block(), edge_def::dest, dump_file, edge_def::flags, invert_jump(), basic_block_def::next_bb, redirect_edge_succ_nodup(), single_pred_p(), single_succ(), basic_block_def::succs, tidy_fallthru_edge(), update_br_prob_note(), and update_forwarder_flag().
|
static |
Referenced by merge_blocks_move(), try_crossjump_to_edge(), try_optimize_cfg(), and try_simplify_condjump().
|
static |
Recompute forwarder flag after block has been modified.
References basic_block_def::flags, and forwarder_block_p().
|
static |
References cfun, find_fallthru_edge(), single_succ_p(), and edge_def::src.
Referenced by flow_find_cross_jump().
|
static |
Set to true if we couldn't run an optimization due to stale liveness information; we should run df_analyze to enable more opportunities.
Referenced by try_head_merge_bb(), and try_optimize_cfg().
|
static |
Set to true if crossjumps occurred in the latest run of try_optimize_cfg.
Referenced by cleanup_cfg(), try_crossjump_bb(), try_head_merge_bb(), and try_optimize_cfg().
|
static |
Set to true when we are running first pass of try_optimize_cfg loop.
Referenced by try_crossjump_bb(), try_forward_edges(), and try_optimize_cfg().