GCC Middle and Back End API Reference
cprop.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "rtlanal.h"
#include "cfghooks.h"
#include "df.h"
#include "insn-config.h"
#include "memmodel.h"
#include "emit-rtl.h"
#include "recog.h"
#include "diagnostic-core.h"
#include "toplev.h"
#include "cfgrtl.h"
#include "cfganal.h"
#include "lcm.h"
#include "cfgcleanup.h"
#include "cselib.h"
#include "intl.h"
#include "tree-pass.h"
#include "dbgcnt.h"
#include "cfgloop.h"
#include "gcse.h"
Include dependency graph for cprop.cc:

Data Structures

struct  cprop_occr
 
struct  cprop_expr
 
struct  hash_table_d
 

Macros

#define GOBNEW(T)   ((T *) cprop_alloc (sizeof (T)))
 
#define GOBNEWVAR(T, S)   ((T *) cprop_alloc ((S)))
 
#define MAX_USES   8
 

Functions

static voidcprop_alloc (unsigned long size)
 
static bool reg_available_p (const_rtx x, const rtx_insn *insn)
 
static unsigned int hash_mod (int regno, int hash_table_size)
 
static void insert_set_in_table (rtx dest, rtx src, rtx_insn *insn, struct hash_table_d *table, bool implicit)
 
static bool cprop_constant_p (const_rtx x)
 
static bool cprop_reg_p (const_rtx x)
 
static void hash_scan_set (rtx set, rtx_insn *insn, struct hash_table_d *table, bool implicit)
 
static void hash_scan_insn (rtx_insn *insn, struct hash_table_d *table)
 
static void dump_hash_table (FILE *file, const char *name, struct hash_table_d *table)
 
static void make_set_regs_unavailable (rtx_insn *insn)
 
static void compute_hash_table_work (struct hash_table_d *table)
 
static void alloc_hash_table (struct hash_table_d *table)
 
static void free_hash_table (struct hash_table_d *table)
 
static void compute_hash_table (struct hash_table_d *table)
 
static struct cprop_exprlookup_set (unsigned int regno, struct hash_table_d *table)
 
static struct cprop_exprnext_set (unsigned int regno, struct cprop_expr *expr)
 
static void reset_opr_set_tables (void)
 
static bool reg_not_set_p (const_rtx x, const rtx_insn *insn)
 
static void mark_oprs_set (rtx_insn *insn)
 
static void alloc_cprop_mem (int n_blocks, int n_sets)
 
static void free_cprop_mem (void)
 
static void compute_local_properties (sbitmap *kill, sbitmap *comp, struct hash_table_d *table)
 
static void compute_cprop_data (void)
 
static void find_used_regs (rtx *xptr, void *data)
 
static bool try_replace_reg (rtx from, rtx to, rtx_insn *insn)
 
static void find_avail_set (int regno, rtx_insn *insn, struct cprop_expr *set_ret[2])
 
static bool cprop_jump (basic_block bb, rtx_insn *setcc, rtx_insn *jump, rtx from, rtx src)
 
static bool constprop_register (rtx from, rtx src, rtx_insn *insn)
 
static bool cprop_insn (rtx_insn *insn)
 
static void local_cprop_find_used_regs (rtx *xptr, void *data)
 
static bool do_local_cprop (rtx x, rtx_insn *insn)
 
static bool local_cprop_pass (void)
 
rtx fis_get_condition (rtx_insn *jump)
 
static bool implicit_set_cond_p (const_rtx cond)
 
static bool find_implicit_sets (void)
 
static struct cprop_exprfind_bypass_set (int regno, int bb)
 
static bool reg_killed_on_edge (const_rtx reg, const_edge e)
 
static bool bypass_block (basic_block bb, rtx_insn *setcc, rtx_insn *jump)
 
static bool bypass_conditional_jumps (void)
 
static bool one_cprop_pass (void)
 
static unsigned int execute_rtl_cprop (void)
 
rtl_opt_passmake_pass_rtl_cprop (gcc::context *ctxt)
 

Variables

static struct obstack cprop_obstack
 
static struct hash_table_d set_hash_table
 
static rtximplicit_sets
 
static int * implicit_set_indexes
 
static regset reg_set_bitmap
 
static int bytes_used
 
static int local_const_prop_count
 
static int local_copy_prop_count
 
static int global_const_prop_count
 
static int global_copy_prop_count
 
static sbitmapcprop_avloc
 
static sbitmapcprop_kill
 
static sbitmapcprop_avin
 
static sbitmapcprop_avout
 
static rtx reg_use_table [MAX_USES]
 
static unsigned reg_use_count
 
static int bypass_last_basic_block
 

Macro Definition Documentation

◆ GOBNEW

#define GOBNEW ( T)    ((T *) cprop_alloc (sizeof (T)))

Referenced by insert_set_in_table().

◆ GOBNEWVAR

#define GOBNEWVAR ( T,
S )   ((T *) cprop_alloc ((S)))

◆ MAX_USES

#define MAX_USES   8
Copy/constant propagation.   
Maximum number of register uses in an insn that we handle.   

Referenced by find_used_regs().

Function Documentation

◆ alloc_cprop_mem()

static void alloc_cprop_mem ( int n_blocks,
int n_sets )
static
Allocate vars used for copy/const propagation.  N_BLOCKS is the number of
basic blocks.  N_SETS is the number of sets.   

References cprop_avin, cprop_avloc, cprop_avout, cprop_kill, and sbitmap_vector_alloc().

Referenced by one_cprop_pass().

◆ alloc_hash_table()

static void alloc_hash_table ( struct hash_table_d * table)
static
Allocate space for the set/expr hash TABLE.
It is used to determine the number of buckets to use.   

References get_max_insn_count(), ggc_alloc(), and table.

Referenced by one_cprop_pass().

◆ bypass_block()

static bool bypass_block ( basic_block bb,
rtx_insn * setcc,
rtx_insn * jump )
static
Subroutine of bypass_conditional_jumps that attempts to bypass the given
basic block BB which has more than one predecessor.  If not NULL, SETCC
is the first instruction of BB, which is immediately followed by JUMP_INSN
JUMP.  Otherwise, SETCC is NULL, and JUMP is the first insn of BB.
Returns true if a change was made.

During the jump bypassing pass, we may place copies of SETCC instructions
on CFG edges.  The following routine must be careful to pay attention to
these inserted insns when performing its transformations.   

References BLOCK_FOR_INSN(), bypass_last_basic_block, cfun, copy_insn(), current_loops, cprop_expr::dest, dump_file, EDGE_COMPLEX, ei_next(), ei_safe_edge(), ei_start, EXIT_BLOCK_PTR_FOR_FN, FALLTHRU_EDGE, find_bypass_set(), find_edge(), find_reg_equal_equiv_note(), find_used_regs(), FOR_EACH_EDGE, GET_CODE, ggc_alloc(), loop::header, i, insert_insn_on_edge(), INSN_UID(), basic_block_def::loop_father, note_uses(), NULL, PATTERN(), pc_rtx, pc_set(), basic_block_def::preds, print_rtl(), redirect_edge_and_branch_force(), reg_killed_on_edge(), reg_use_count, reg_use_table, REGNO, SET_DEST, SET_SRC, simplify_replace_rtx(), cprop_expr::src, set::src, and XEXP.

Referenced by bypass_conditional_jumps().

◆ bypass_conditional_jumps()

static bool bypass_conditional_jumps ( void )
static
Find basic blocks with more than one predecessor that only contain a
single conditional jump.  If the result of the comparison is known at
compile-time from any incoming edge, redirect that edge to the
appropriate target.  Return nonzero if a change was made.

This function is now mis-named, because we also handle indirect jumps.   

References any_condjump_p(), bypass_block(), cfun, changed, commit_edge_insertions(), computed_jump_p(), DEBUG_INSN_P, cprop_expr::dest, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, FOR_BB_BETWEEN, FOR_BB_INSNS, GET_CODE, ggc_alloc(), INSN_P, JUMP_P, mark_dfs_back_edges(), basic_block_def::next_bb, NONJUMP_INSN_P, NULL, onlyjump_p(), PATTERN(), REG_P, SET, SET_DEST, and single_pred_p().

Referenced by one_cprop_pass().

◆ compute_cprop_data()

static void compute_cprop_data ( void )
static
Hash table support.   
Top level routine to do the dataflow analysis needed by copy/const
propagation.   

References bitmap_set_bit, cfun, compute_available(), compute_local_properties(), cprop_avin, cprop_avloc, cprop_avout, cprop_kill, FOR_EACH_BB_FN, implicit_set_indexes, basic_block_def::index, and set_hash_table.

Referenced by one_cprop_pass().

◆ compute_hash_table()

static void compute_hash_table ( struct hash_table_d * table)
static
Compute the hash TABLE for doing copy/const propagation or
expression hash table.   

References compute_hash_table_work(), ggc_alloc(), and table.

◆ compute_hash_table_work()

static void compute_hash_table_work ( struct hash_table_d * table)
static
Top level function to create an assignment hash table.

Assignment entries are placed in the hash table if
- they are of the form (set (pseudo-reg) src),
- src is something we want to perform const/copy propagation on,
- none of the operands or target are subsequently modified in the block

Currently src must be a pseudo-reg or a const_int.

TABLE is the table computed.   

References ALLOC_REG_SET, BB_HEAD, cfun, CLEAR_REG_SET, FOR_BB_INSNS_REVERSE, FOR_EACH_BB_FN, FREE_REG_SET, hash_scan_insn(), hash_scan_set(), implicit_sets, basic_block_def::index, make_set_regs_unavailable(), NONDEBUG_INSN_P, NULL, NULL_RTX, reg_set_bitmap, and table.

Referenced by compute_hash_table().

◆ compute_local_properties()

static void compute_local_properties ( sbitmap * kill,
sbitmap * comp,
struct hash_table_d * table )
static
Compute the local properties of each recorded expression.

Local properties are those that are defined by the block, irrespective of
other blocks.

An expression is killed in a block if its operands, either DEST or SRC, are
modified in the block.

An expression is computed (locally available) in a block if it is computed
at least once and expression would contain the same value if the
computation was moved to the end of the block.

KILL and COMP are destination sbitmaps for recording local properties.   

References expr::avail_occr, expr::bitmap_index, bitmap_set_bit, bitmap_vector_clear(), BLOCK_FOR_INSN(), cfun, comp, DF_REF_BB, DF_REF_NEXT_REG, DF_REG_DEF_CHAIN, expr, i, basic_block_def::index, occr::insn, kill, last_basic_block_for_fn, occr::next, NULL, REG_P, REGNO, and table.

Referenced by compute_cprop_data().

◆ constprop_register()

static bool constprop_register ( rtx from,
rtx src,
rtx_insn * insn )
static
Subroutine of cprop_insn that tries to propagate constants.  FROM is what
we will try to replace, SRC is the constant we will try to substitute for
it and INSN is the instruction where this will be happening.   

References any_condjump_p(), BLOCK_FOR_INSN(), cprop_jump(), cprop_expr::dest, ggc_alloc(), next_insn(), next_nondebug_insn(), NONJUMP_INSN_P, NULL, onlyjump_p(), REG_P, SET_DEST, single_set(), cprop_expr::src, and try_replace_reg().

Referenced by cprop_insn(), and do_local_cprop().

◆ cprop_alloc()

static void * cprop_alloc ( unsigned long size)
static
Cover function to obstack_alloc.   

References bytes_used, cprop_obstack, ggc_alloc(), and hash_table_d::size.

◆ cprop_constant_p()

static bool cprop_constant_p ( const_rtx x)
static
Determine whether the rtx X should be treated as a constant for CPROP.
Since X might be inserted more than once we have to take care that it
is sharable.   

References CONSTANT_P, GET_CODE, ggc_alloc(), and shared_const_p().

Referenced by cprop_insn(), do_local_cprop(), find_avail_set(), find_bypass_set(), hash_scan_set(), and implicit_set_cond_p().

◆ cprop_insn()

◆ cprop_jump()

static bool cprop_jump ( basic_block bb,
rtx_insn * setcc,
rtx_insn * jump,
rtx from,
rtx src )
static
Subroutine of cprop_insn that tries to propagate constants into
JUMP_INSNS.  JUMP must be a conditional jump.  If SETCC is non-NULL
it is the instruction that immediately precedes JUMP, and must be a
single SET of a register.  FROM is what we will try to replace,
SRC is the constant we will try to substitute for it.  Return true
if a change was made.   

References BB_HEAD, cfun, copy_rtx(), delete_insn(), dump_file, EXIT_BLOCK_PTR_FOR_FN, find_reg_equal_equiv_note(), FOR_EACH_EDGE, GET_CODE, ggc_alloc(), global_const_prop_count, INSN_UID(), JUMP_LABEL, modified_between_p(), modified_in_p(), NULL, NULL_RTX, pc_rtx, pc_set(), print_rtl(), purge_dead_edges(), REGNO, remove_note(), rtx_equal_p(), SET_DEST, SET_SRC, set_unique_reg_note(), simplejump_p(), simplify_replace_rtx(), single_set(), cprop_expr::src, basic_block_def::succs, validate_unshare_change(), and XEXP.

Referenced by constprop_register().

◆ cprop_reg_p()

static bool cprop_reg_p ( const_rtx x)
static
Determine whether the rtx X should be treated as a register that can
be propagated.  Any pseudo-register is fine.   

References HARD_REGISTER_P, and REG_P.

Referenced by cprop_insn(), do_local_cprop(), hash_scan_set(), and implicit_set_cond_p().

◆ do_local_cprop()

◆ dump_hash_table()

static void dump_hash_table ( FILE * file,
const char * name,
struct hash_table_d * table )
static
Dump the hash table TABLE to file FILE under the name NAME.   

References expr::bitmap_index, expr, free(), ggc_alloc(), i, NULL, print_rtl(), and table.

Referenced by one_cprop_pass().

◆ execute_rtl_cprop()

static unsigned int execute_rtl_cprop ( void )
static
All the passes implemented in this file.  Each pass has its
own gate and execute function, and at the end of the file a
pass definition for passes.cc.

We do not construct an accurate cfg in functions which call
setjmp, so none of these passes runs if the function calls
setjmp.
FIXME: Should just handle setjmp via REG_SETJMP notes.   

References changed, cleanup_cfg(), CLEANUP_CFG_CHANGED, delete_unreachable_blocks(), df_analyze(), DF_LR_RUN_DCE, df_set_flags(), flag_rerun_cse_after_global_opts, and one_cprop_pass().

◆ find_avail_set()

static void find_avail_set ( int regno,
rtx_insn * insn,
struct cprop_expr * set_ret[2] )
static
Find a set of REGNOs that are available on entry to INSN's block.  If found,
SET_RET[0] will be assigned a set with a register source and SET_RET[1] a
set with a constant source.  If not found the corresponding entry is set to
NULL.   

References bitmap_bit_p, BLOCK_FOR_INSN(), cprop_avin, cprop_constant_p(), ggc_alloc(), lookup_set(), next_set(), NULL, reg_not_set_p(), REG_P, REGNO, set_hash_table, cprop_expr::src, and set::src.

Referenced by cprop_insn().

◆ find_bypass_set()

static struct cprop_expr * find_bypass_set ( int regno,
int bb )
static
Find a set of REGNO to a constant that is available at the end of basic
block BB.  Return NULL if no such set is found.  Based heavily upon
find_avail_set.   

References bitmap_bit_p, cprop_avout, cprop_constant_p(), lookup_set(), next_set(), REG_P, REGNO, set_hash_table, cprop_expr::src, and set::src.

Referenced by bypass_block().

◆ find_implicit_sets()

static bool find_implicit_sets ( void )
static
Find the implicit sets of a function.  An "implicit set" is a constraint
on the value of a variable, implied by a conditional jump.  For example,
following "if (x == 2)", the then branch may be optimized as though the
conditional performed an "explicit set", in this example, "x = 2".  This
function records the set patterns that are implicit at the start of each
basic block.

If an implicit set is found but the set is implicit on a critical edge,
this critical edge is split.

Return true if the CFG was modified, false otherwise.   

References BB_END, BRANCH_EDGE, cfun, count, dump_file, EDGE_COUNT, EXIT_BLOCK_PTR_FOR_FN, FALLTHRU_EDGE, find_edge(), fis_get_condition(), FOR_EACH_BB_FN, GET_CODE, ggc_alloc(), implicit_set_cond_p(), implicit_sets, basic_block_def::index, last_basic_block_for_fn, REGNO, single_pred_p(), split_edge(), basic_block_def::succs, and XEXP.

Referenced by one_cprop_pass().

◆ find_used_regs()

static void find_used_regs ( rtx * xptr,
void * data )
static
Set up a list of register numbers used in INSN.  The found uses are stored
in `reg_use_table'.  `reg_use_count' is initialized to zero before entry,
and contains the number of uses in the table upon exit.

??? If a register appears multiple times we will record it multiple times.
This doesn't hurt anything but it will slow things down.   

References find_used_regs(), GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, ggc_alloc(), i, MAX_USES, REG_P, reg_use_count, reg_use_table, XEXP, XVECEXP, and XVECLEN.

Referenced by bypass_block(), cprop_insn(), find_used_regs(), and local_cprop_find_used_regs().

◆ fis_get_condition()

rtx fis_get_condition ( rtx_insn * jump)
Similar to get_condition, only the resulting condition must be
valid at JUMP, instead of at EARLIEST.

This differs from noce_get_condition in ifcvt.cc in that we prefer not to
settle for the condition variable in the jump instruction being integral.
We prefer to be able to record the value of a user variable, rather than
the value of a temporary used in a condition.  This could be solved by
recording the value of *every* register scanned by canonicalize_condition,
but this would require some code reorganization.   

References get_condition(), and NULL.

Referenced by find_implicit_sets(), and reload_cse_move2add_invalidate().

◆ free_cprop_mem()

static void free_cprop_mem ( void )
static
Free vars used by copy/const propagation.   

References cprop_avin, cprop_avloc, cprop_avout, cprop_kill, and sbitmap_vector_free().

Referenced by one_cprop_pass().

◆ free_hash_table()

static void free_hash_table ( struct hash_table_d * table)
static
Free things allocated by alloc_hash_table.   

References free(), and table.

Referenced by one_cprop_pass().

◆ hash_mod()

static unsigned int hash_mod ( int regno,
int hash_table_size )
static
Hash a set of register REGNO.

Sets are hashed on the register that is set.  This simplifies the PRE copy
propagation code.

??? May need to make things more elaborate.  Later, as necessary.   

References ggc_alloc().

Referenced by insert_set_in_table(), and lookup_set().

◆ hash_scan_insn()

static void hash_scan_insn ( rtx_insn * insn,
struct hash_table_d * table )
static
Process INSN and add hash table entries as appropriate.   

References GET_CODE, ggc_alloc(), hash_scan_set(), i, cprop_occr::insn, PATTERN(), SET, table, XVECEXP, and XVECLEN.

Referenced by compute_hash_table_work().

◆ hash_scan_set()

static void hash_scan_set ( rtx set,
rtx_insn * insn,
struct hash_table_d * table,
bool implicit )
static
Scan SET present in INSN and add an entry to the hash TABLE.
IMPLICIT is true if it's an implicit set, false otherwise.   

References can_copy_p(), cprop_constant_p(), cprop_reg_p(), find_reg_equal_equiv_note(), GET_MODE, ggc_alloc(), insert_set_in_table(), cprop_occr::insn, reg_available_p(), REG_NOTE_KIND, REG_P, SET_DEST, SET_SRC, table, and XEXP.

Referenced by compute_hash_table_work(), and hash_scan_insn().

◆ implicit_set_cond_p()

static bool implicit_set_cond_p ( const_rtx cond)
static
Check the comparison COND to see if we can safely form an implicit
set from it.   

References CONST_DOUBLE_AS_FLOAT_P, CONST_DOUBLE_REAL_VALUE, cprop_constant_p(), cprop_reg_p(), dconst0, GET_CODE, GET_MODE, ggc_alloc(), HONOR_SIGNED_ZEROS(), real_equal(), and XEXP.

Referenced by find_implicit_sets().

◆ insert_set_in_table()

static void insert_set_in_table ( rtx dest,
rtx src,
rtx_insn * insn,
struct hash_table_d * table,
bool implicit )
static
Insert assignment DEST:=SET from INSN in the hash table.
DEST is a register and SET is a register or a suitable constant.
If the assignment is already present in the table, record it as
the last occurrence in INSN's basic block.
IMPLICIT is true if it's an implicit set, false otherwise.   

References BLOCK_FOR_INSN(), bytes_used, copy_rtx(), cprop_expr::dest, ggc_alloc(), GOBNEW, hash_mod(), implicit_set_indexes, basic_block_def::index, cprop_occr::insn, NULL, REGNO, cprop_expr::src, and table.

Referenced by hash_scan_set().

◆ local_cprop_find_used_regs()

static void local_cprop_find_used_regs ( rtx * xptr,
void * data )
static
Like find_used_regs, but avoid recording uses that appear in
input-output contexts such as zero_extract or pre_dec.  This
restricts the cases we consider to those for which local cprop
can legitimately make replacements.   

References find_used_regs(), GET_CODE, ggc_alloc(), and read_modify_subreg_p().

Referenced by local_cprop_pass().

◆ local_cprop_pass()

◆ lookup_set()

static struct cprop_expr * lookup_set ( unsigned int regno,
struct hash_table_d * table )
static
Expression tracking support.   
Lookup REGNO in the set TABLE.  The result is a pointer to the
table entry, or NULL if not found.   

References expr, hash_mod(), REGNO, and table.

Referenced by find_avail_set(), and find_bypass_set().

◆ make_pass_rtl_cprop()

rtl_opt_pass * make_pass_rtl_cprop ( gcc::context * ctxt)

References ggc_alloc().

◆ make_set_regs_unavailable()

static void make_set_regs_unavailable ( rtx_insn * insn)
static
Record as unavailable all registers that are DEF operands of INSN.   

References DF_REF_REGNO, FOR_EACH_INSN_DEF, reg_set_bitmap, and SET_REGNO_REG_SET.

Referenced by compute_hash_table_work().

◆ mark_oprs_set()

static void mark_oprs_set ( rtx_insn * insn)
static
Record things set by INSN.
This data is used by reg_not_set_p.   

References DF_REF_REGNO, FOR_EACH_INSN_DEF, reg_set_bitmap, and SET_REGNO_REG_SET.

Referenced by one_cprop_pass().

◆ next_set()

static struct cprop_expr * next_set ( unsigned int regno,
struct cprop_expr * expr )
static
Return the next entry for REGNO in list EXPR.   

References expr, and REGNO.

Referenced by find_avail_set(), and find_bypass_set().

◆ one_cprop_pass()

◆ reg_available_p()

static bool reg_available_p ( const_rtx x,
const rtx_insn * insn )
static
Return true if register X is unchanged from INSN to the end
of INSN's basic block.   

References reg_set_bitmap, REGNO, and REGNO_REG_SET_P.

Referenced by hash_scan_set().

◆ reg_killed_on_edge()

static bool reg_killed_on_edge ( const_rtx reg,
const_edge e )
static
Subroutine of bypass_block that checks whether a pseudo is killed by
any of the instructions inserted on an edge.  Jump bypassing places
condition code setters on CFG edges using insert_insn_on_edge.  This
function is required to check that our data flow analysis is still
valid prior to commit_edge_insertions.   

References INSN_P, NEXT_INSN(), and reg_set_p().

Referenced by bypass_block().

◆ reg_not_set_p()

static bool reg_not_set_p ( const_rtx x,
const rtx_insn * insn )
static
Return true if the register X has not been set yet [since the
start of the basic block containing INSN].   

References reg_set_bitmap, REGNO, and REGNO_REG_SET_P.

Referenced by cprop_insn(), and find_avail_set().

◆ reset_opr_set_tables()

static void reset_opr_set_tables ( void )
static
Reset tables used to keep track of what's still available [since the
start of the block].   

References CLEAR_REG_SET, and reg_set_bitmap.

Referenced by one_cprop_pass().

◆ try_replace_reg()

Variable Documentation

◆ bypass_last_basic_block

int bypass_last_basic_block
static
Bypass conditional jumps.   
The value of last_basic_block at the beginning of the jump_bypass
pass.  The use of redirect_edge_and_branch_force may introduce new
basic blocks, but the data flow analysis is only valid for basic
block indices less than bypass_last_basic_block.   

Referenced by bypass_block(), and one_cprop_pass().

◆ bytes_used

int bytes_used
static
Various variables for statistics gathering.   
Memory used in a pass.
This isn't intended to be absolutely precise.  Its intent is only
to keep an eye on memory usage.   

Referenced by cprop_alloc(), insert_set_in_table(), and one_cprop_pass().

◆ cprop_avin

sbitmap* cprop_avin
static
Global properties of assignments (computed from the local properties).   

Referenced by alloc_cprop_mem(), compute_cprop_data(), find_avail_set(), and free_cprop_mem().

◆ cprop_avloc

sbitmap* cprop_avloc
static
Compute copy/constant propagation working variables.   
Local properties of assignments.   

Referenced by alloc_cprop_mem(), compute_cprop_data(), and free_cprop_mem().

◆ cprop_avout

◆ cprop_kill

sbitmap* cprop_kill
static

◆ cprop_obstack

struct obstack cprop_obstack
static
Global constant/copy propagation for RTL.
   Copyright (C) 1997-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/>.   
An obstack for our working variables.   

Referenced by cprop_alloc(), and one_cprop_pass().

◆ global_const_prop_count

int global_const_prop_count
static
Number of global constants propagated.   

Referenced by cprop_insn(), cprop_jump(), and one_cprop_pass().

◆ global_copy_prop_count

int global_copy_prop_count
static
Number of global copies propagated.   

Referenced by cprop_insn(), and one_cprop_pass().

◆ implicit_set_indexes

int* implicit_set_indexes
static
Array of indexes of expressions for implicit set patterns indexed by basic
block index.  In other words, implicit_set_indexes[i] is the bitmap_index
of the expression whose RTX is implicit_sets[i].   

Referenced by compute_cprop_data(), insert_set_in_table(), and one_cprop_pass().

◆ implicit_sets

rtx* implicit_sets
static
Array of implicit set patterns indexed by basic block index.   

Referenced by compute_hash_table_work(), find_implicit_sets(), and one_cprop_pass().

◆ local_const_prop_count

int local_const_prop_count
static
Number of local constants propagated.   

Referenced by do_local_cprop(), and one_cprop_pass().

◆ local_copy_prop_count

int local_copy_prop_count
static
Number of local copies propagated.   

Referenced by do_local_cprop(), and one_cprop_pass().

◆ reg_set_bitmap

regset reg_set_bitmap
static
Bitmap containing one bit for each register in the program.
Used when performing GCSE to track which registers have been set since
the start or end of the basic block while traversing that block.   

Referenced by compute_hash_table_work(), make_set_regs_unavailable(), mark_oprs_set(), one_cprop_pass(), reg_available_p(), reg_not_set_p(), and reset_opr_set_tables().

◆ reg_use_count

unsigned reg_use_count
static
Index into `reg_use_table' while building it.   

Referenced by bypass_block(), cprop_insn(), find_used_regs(), and local_cprop_pass().

◆ reg_use_table

rtx reg_use_table[MAX_USES]
static
Table of uses (registers, both hard and pseudo) found in an insn.
Allocated statically to avoid alloc/free complexity and overhead.   

Referenced by bypass_block(), cprop_insn(), find_used_regs(), and local_cprop_pass().

◆ set_hash_table

struct hash_table_d set_hash_table
static
Copy propagation hash table.   

Referenced by compute_cprop_data(), find_avail_set(), find_bypass_set(), and one_cprop_pass().