GCC Middle and Back End API Reference
cfgbuild.cc File 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"
Include dependency graph for cfgbuild.cc:

Macros

#define STATE(BB)   (enum state) ((size_t) (BB)->aux)
 
#define SET_STATE(BB, STATE)   ((BB)->aux = (void *) (size_t) (STATE))
 
#define BLOCK_USED_BY_TABLEJUMP   32
 
#define FULL_STATE(BB)   ((size_t) (BB)->aux)
 

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)
 

Macro Definition Documentation

◆ BLOCK_USED_BY_TABLEJUMP

#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().

◆ FULL_STATE

#define FULL_STATE ( BB)    ((size_t) (BB)->aux)

◆ SET_STATE

#define SET_STATE ( BB,
STATE )   ((BB)->aux = (void *) (size_t) (STATE))

◆ STATE

#define STATE ( BB)    (enum state) ((size_t) (BB)->aux)

Enumeration Type Documentation

◆ state

enum state
States of basic block as seen by find_many_sub_basic_blocks.   
Enumerator
BLOCK_NEW 
BLOCK_ORIGINAL 
BLOCK_TO_SPLIT 

Function Documentation

◆ compute_outgoing_frequencies()

◆ control_flow_insn_p()

◆ find_bb_boundaries()

◆ find_many_sub_basic_blocks()

◆ find_sub_basic_blocks()

◆ inside_basic_block_p()

bool inside_basic_block_p ( const rtx_insn * insn)
Return true if insn is something that should be contained inside basic
block.   

References gcc_unreachable, GET_CODE, ggc_alloc(), JUMP_TABLE_DATA_P, and NEXT_INSN().

Referenced by find_bb_boundaries(), save_point_p(), and scan_trace().

◆ make_edges()

static void make_edges ( basic_block min,
basic_block max,
int update_p )
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, ggc_alloc(), 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.

◆ make_label_edge()

static void make_label_edge ( sbitmap edge_cache,
basic_block src,
rtx label,
int flags )
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, ggc_alloc(), INSN_UID(), and LABEL_P.

Referenced by make_edges(), and rtl_make_eh_edge().

◆ mark_tablejump_edge()

static void mark_tablejump_edge ( rtx label)
static

◆ purge_dead_tablejump_edges()

◆ rtl_make_eh_edge()

void rtl_make_eh_edge ( sbitmap edge_cache,
basic_block src,
rtx insn )

◆ update_profile_for_new_sub_basic_block()

static void update_profile_for_new_sub_basic_block ( basic_block bb)
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, ggc_alloc(), 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().