GCC Middle and Back End API Reference
cfgcleanup.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  replace_direction { dir_none , dir_forward , dir_backward , dir_both }
 

Functions

int flow_find_cross_jump (basic_block, basic_block, rtx_insn **, rtx_insn **, enum replace_direction *)
 
int flow_find_head_matching_sequence (basic_block, basic_block, rtx_insn **, rtx_insn **, int)
 
bool delete_unreachable_blocks (void)
 
void delete_dead_jumptables (void)
 
bool cleanup_cfg (int)
 
bool bb_is_just_return (basic_block, rtx_insn **, rtx_insn **)
 

Enumeration Type Documentation

◆ replace_direction

Control flow optimization header file.
   Copyright (C) 2014-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/>.   
Enumerator
dir_none 
dir_forward 
dir_backward 
dir_both 

Function Documentation

◆ bb_is_just_return()

bool bb_is_just_return ( basic_block bb,
rtx_insn ** ret,
rtx_insn ** use )
extern
Return true if BB contains just a return and possibly a USE of the
return value.  Fill in *RET and *USE with the return and use insns
if any found, otherwise NULL.  All CLOBBERs are ignored.   

References ANY_RETURN_P, cfun, EXIT_BLOCK_PTR_FOR_FN, FOR_BB_INSNS_REVERSE, GET_CODE, NONDEBUG_INSN_P, NULL, PATTERN(), REG_FUNCTION_VALUE_P, REG_P, and XEXP.

Referenced by fixup_reorder_chain(), and try_optimize_cfg().

◆ cleanup_cfg()

◆ delete_dead_jumptables()

void delete_dead_jumptables ( void )
extern
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 BB_END, cfun, delete_insn(), dump_file, FOR_EACH_BB_FN, INSN_UID(), JUMP_TABLE_DATA_P, LABEL_NUSES, LABEL_P, LABEL_PRESERVE_P, NEXT_INSN(), and NOTE_INSN_BASIC_BLOCK_P.

Referenced by cfg_layout_finalize(), and cleanup_cfg().

◆ delete_unreachable_blocks()

◆ flow_find_cross_jump()

int flow_find_cross_jump ( basic_block bb1,
basic_block bb2,
rtx_insn ** f1,
rtx_insn ** f2,
enum replace_direction * dir_p )
extern
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 active_insn_p(), BB_END, BB_HEAD, BB_PARTITION, BLOCK_FOR_INSN(), dir_backward, dir_both, dir_forward, dir_none, f1, f2, i1, i2, INSN_P, LABEL_P, merge_dir(), merge_memattrs(), merge_notes(), NONDEBUG_INSN_P, NULL, old_insns_match_p(), onlyjump_p(), PATTERN(), PREV_INSN(), reload_completed, returnjump_p(), side_effects_p(), simplejump_p(), and walk_to_nondebug_insn().

Referenced by cond_exec_process_if_block(), and try_crossjump_to_edge().

◆ flow_find_head_matching_sequence()

int flow_find_head_matching_sequence ( basic_block bb1,
basic_block bb2,
rtx_insn ** f1,
rtx_insn ** f2,
int stop_after )
extern
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.  If STOP_AFTER is zero, count all INSN_P insns, if it is
non-zero, only count active insns.   

References active_insn_p(), BB_END, BB_HEAD, dir_both, f1, f2, FOR_EACH_EDGE, i1, i2, INSN_P, JUMP_P, merge_memattrs(), merge_notes(), NEXT_INSN(), NONDEBUG_INSN_P, NOTE_KIND, NOTE_P, NULL, old_insns_match_p(), and basic_block_def::succs.

Referenced by cond_exec_process_if_block(), and try_head_merge_bb().