GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "cfghooks.h"
#include "memmodel.h"
#include "emit-rtl.h"
#include "cfgrtl.h"
#include "cfganal.h"
#include "cfgbuild.h"
#include "except.h"
#include "stmt.h"
Macros | |
#define | STATE(BB) |
#define | SET_STATE(BB, STATE) |
#define | BLOCK_USED_BY_TABLEJUMP 32 |
#define | FULL_STATE(BB) |
Enumerations | |
enum | state { BLOCK_NEW = 0 , BLOCK_ORIGINAL , BLOCK_TO_SPLIT } |
Functions | |
static void | make_edges (basic_block, basic_block, int) |
static void | make_label_edge (sbitmap, basic_block, rtx, int) |
static void | find_bb_boundaries (basic_block) |
static void | compute_outgoing_frequencies (basic_block) |
bool | inside_basic_block_p (const rtx_insn *insn) |
bool | control_flow_insn_p (const rtx_insn *insn) |
void | rtl_make_eh_edge (sbitmap edge_cache, basic_block src, rtx insn) |
static void | mark_tablejump_edge (rtx label) |
static void | purge_dead_tablejump_edges (basic_block bb, rtx_jump_table_data *table) |
static void | update_profile_for_new_sub_basic_block (basic_block bb) |
void | find_many_sub_basic_blocks (sbitmap blocks) |
void | find_sub_basic_blocks (basic_block bb) |
#define BLOCK_USED_BY_TABLEJUMP 32 |
Used internally by purge_dead_tablejump_edges, ORed into state.
Referenced by mark_tablejump_edge(), and purge_dead_tablejump_edges().
#define FULL_STATE | ( | BB | ) |
Referenced by mark_tablejump_edge(), and purge_dead_tablejump_edges().
#define SET_STATE | ( | BB, | |
STATE ) |
Referenced by find_many_sub_basic_blocks(), mark_tablejump_edge(), and purge_dead_tablejump_edges().
#define STATE | ( | BB | ) |
Referenced by find_many_sub_basic_blocks(), and make_edges().
enum state |
|
static |
Assume that frequency of basic block B is known. Compute frequencies and probabilities of outgoing edges.
References profile_probability::always(), b, BB_END, BRANCH_EDGE, EDGE_COMPLEX, EDGE_COUNT, FALLTHRU_EDGE, find_reg_note(), FOR_EACH_EDGE, profile_probability::from_reg_br_prob_note(), guess_outgoing_edge_probabilities(), NULL, single_succ_edge(), single_succ_p(), and XINT.
Referenced by find_many_sub_basic_blocks(), find_sub_basic_blocks(), and update_profile_for_new_sub_basic_block().
Return true if INSN may cause control flow transfer, so it should be last in the basic block.
References can_nonlocal_goto(), can_throw_internal(), cfun, const1_rtx, find_reg_note(), gcc_unreachable, GET_CODE, PATTERN(), SIBLING_CALL_P, and XEXP.
Referenced by add_labels_and_missing_jumps(), dce_process_block(), decompose_multiword_subregs(), emit_common_tails_for_components(), emit_moves(), find_bb_boundaries(), find_moveable_pseudos(), reload_combine(), rtl_verify_bb_insns(), try_head_merge_bb(), unify_moves(), and word_dce_process_block().
|
static |
Scan basic block BB for possible BB boundaries inside the block and create new basic blocks in the progress.
References BARRIER_P, BB_END, BB_HEAD, cfun, control_flow_insn_p(), basic_block_def::count, debug_insn, DEBUG_INSN_P, delete_insn(), end(), ENTRY_BLOCK_PTR_FOR_FN, gcc_assert, GET_CODE, inside_basic_block_p(), LABEL_ALT_ENTRY_P, LABEL_P, last, make_edge(), NEXT_INSN(), NOTE_P, NULL, PREV_INSN(), prev_nonnote_nondebug_insn_bb(), purge_dead_edges(), purge_dead_tablejump_edges(), remove_edge(), reorder_insns_nobb(), set_block_for_insn(), split_block(), table, tablejump_p(), and profile_count::uninitialized().
Referenced by find_many_sub_basic_blocks(), and find_sub_basic_blocks().
void find_many_sub_basic_blocks | ( | sbitmap | blocks | ) |
Assume that some pass has inserted labels or control flow instructions within a basic block. Split basic blocks as needed and create edges.
References any_condjump_p(), BB_END, bitmap_bit_p, BLOCK_NEW, BLOCK_ORIGINAL, BLOCK_TO_SPLIT, cfun, compute_outgoing_frequencies(), EDGE_COUNT, EXIT_BLOCK_PTR_FOR_FN, find_bb_boundaries(), FOR_BB_BETWEEN, FOR_EACH_BB_FN, basic_block_def::index, JUMP_P, last_basic_block_for_fn, make_edges(), basic_block_def::next_bb, PROFILE_ABSENT, profile_status_for_fn, SET_STATE, STATE, basic_block_def::succs, update_br_prob_note(), and update_profile_for_new_sub_basic_block().
Referenced by break_superblocks(), lra(), reload(), split_all_insns(), and thread_prologue_and_epilogue_insns().
void find_sub_basic_blocks | ( | basic_block | bb | ) |
Like find_many_sub_basic_blocks, but look only within BB.
References cfun, compute_outgoing_frequencies(), find_bb_boundaries(), make_edges(), basic_block_def::next_bb, basic_block_def::prev_bb, PROFILE_ABSENT, profile_status_for_fn, and update_profile_for_new_sub_basic_block().
Referenced by commit_one_edge_insertion(), and thread_prologue_and_epilogue_insns().
Return true if insn is something that should be contained inside basic block.
References gcc_unreachable, GET_CODE, JUMP_TABLE_DATA_P, and NEXT_INSN().
Referenced by find_bb_boundaries(), save_point_p(), and scan_trace().
|
static |
Control flow graph building code for GNU compiler. Copyright (C) 1987-2024 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/>.
Identify the edges going out of basic blocks between MIN and MAX, inclusive, that have their states set to BLOCK_NEW or BLOCK_TO_SPLIT. UPDATE_P should be nonzero if we are updating CFG and zero if we are building CFG from scratch.
References ASM_OPERANDS_LABEL, ASM_OPERANDS_LABEL_LENGTH, BB_END, BB_HEAD, bitmap_clear(), bitmap_set_bit, BLOCK_ORIGINAL, cached_make_edge(), can_nonlocal_goto(), cfun, computed_jump_p(), ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, extract_asm_operands(), find_edge(), find_reg_note(), FOR_BB_BETWEEN, FOR_EACH_EDGE, FOR_EACH_VEC_SAFE_ELT, forced_labels, gcc_assert, GET_CODE, GET_NUM_ELEM, i, JUMP_LABEL, LABEL_ALT_ENTRY_P, LABEL_P, label_ref_label(), last_basic_block_for_fn, make_edge(), make_label_edge(), rtx_insn_list::next(), basic_block_def::next_bb, NEXT_INSN(), nonlocal_goto_handler_labels, NOTE_KIND, NOTE_P, NULL, NULL_RTX, PATTERN(), pc_rtx, REG_NOTE_KIND, REG_NOTES, returnjump_p(), rtl_make_eh_edge(), RTVEC_ELT, sbitmap_alloc(), sbitmap_free(), SET_DEST, SET_SRC, SIBLING_CALL_P, single_set(), STATE, basic_block_def::succs, table, tablejump_p(), vec_safe_is_empty(), and XEXP.
|
static |
Create an edge between two basic blocks. FLAGS are auxiliary information about the edge that is accumulated between calls.
Create an edge from a basic block to a label.
References BLOCK_FOR_INSN(), cached_make_edge(), gcc_assert, INSN_UID(), and LABEL_P.
Referenced by make_edges(), and rtl_make_eh_edge().
|
static |
References BLOCK_FOR_INSN(), BLOCK_USED_BY_TABLEJUMP, FULL_STATE, gcc_assert, INSN_UID(), LABEL_P, and SET_STATE.
Referenced by purge_dead_tablejump_edges().
|
static |
References BB_END, BLOCK_USED_BY_TABLEJUMP, ei_next(), ei_safe_edge(), ei_start, FULL_STATE, GET_CODE, GET_NUM_ELEM, label_ref_label(), mark_tablejump_edge(), NULL, pc_rtx, remove_edge(), RTVEC_ELT, SET_DEST, SET_SRC, SET_STATE, single_set(), basic_block_def::succs, table, and XEXP.
Referenced by find_bb_boundaries().
void rtl_make_eh_edge | ( | sbitmap | edge_cache, |
basic_block | src, | ||
rtx | insn ) |
Create the edges generated by INSN in REGION.
References CALL_P, gcc_assert, get_eh_landing_pad_from_rtx(), label_rtx(), eh_landing_pad_d::landing_pad, make_label_edge(), NULL, and eh_landing_pad_d::post_landing_pad.
Referenced by decompose_multiword_subregs(), and make_edges().
|
static |
Update the profile information for BB, which was created by splitting an RTL block that had a non-final jump.
References cfun, compute_outgoing_frequencies(), basic_block_def::count, FOR_EACH_EDGE, basic_block_def::preds, PROFILE_GUESSED, profile_status_for_fn, profile_count::uninitialized(), and profile_count::zero().
Referenced by find_many_sub_basic_blocks(), and find_sub_basic_blocks().