osprey/kg++fe/gnu/gcse.c File Reference

#include "config.h"
#include "system.h"
#include "toplev.h"
#include "rtl.h"
#include "tm_p.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "flags.h"
#include "real.h"
#include "insn-config.h"
#include "recog.h"
#include "basic-block.h"
#include "output.h"
#include "function.h"
#include "expr.h"
#include "except.h"
#include "ggc.h"
#include "params.h"
#include "cselib.h"
#include "obstack.h"
#include "gt-gcse.h"

Include dependency graph for gcse.c:

Go to the source code of this file.

Data Types

type  reg_use
type  expr
type  occr
type  hash_table
type  reg_set
type  ls_expr
type  null_pointer_info
type  reg_avail_info

Defines

#define INSN_CUID(INSN)   (uid_cuid[INSN_UID (INSN)])
#define CUID_INSN(CUID)   (cuid_insn[CUID])
#define REG_SET_TABLE_SLOP   100
#define MAX_USES   8
#define MAX_NESTED_LIBCALLS   9
#define ANTIC_STORE_LIST(x)   ((x)->loads)
#define AVAIL_STORE_LIST(x)   ((x)->stores)

Functions/Subroutines

static void compute_can_copy PARAMS ((void))
static char *gmalloc PARAMS ((unsigned int))
static char *grealloc PARAMS ((char *, unsigned int))
static char *gcse_alloc PARAMS ((unsigned long))
static void alloc_gcse_mem PARAMS ((rtx))
static void alloc_reg_set_mem PARAMS ((int))
static int get_bitmap_width PARAMS ((int, int, int))
static void record_one_set PARAMS ((int, rtx))
static void record_set_info PARAMS ((rtx, rtx, void *))
static void hash_scan_insn PARAMS ((rtx, struct hash_table *, int))
static void hash_scan_set PARAMS ((rtx, rtx, struct hash_table *))
static int oprs_unchanged_p PARAMS ((rtx, rtx, int))
static int oprs_anticipatable_p PARAMS ((rtx, rtx))
static void insert_expr_in_table PARAMS ((rtx, enum machine_mode, rtx, int, int, struct hash_table *))
static unsigned int hash_expr PARAMS ((rtx, enum machine_mode, int *, int))
static unsigned int hash_expr_1 PARAMS ((rtx, enum machine_mode, int *))
static unsigned int hash_string_1 PARAMS ((const char *))
static unsigned int hash_set PARAMS ((int, int))
static void
record_last_reg_set_info 
PARAMS ((rtx, int))
static void compute_hash_table PARAMS ((struct hash_table *))
static void alloc_hash_table PARAMS ((int, struct hash_table *, int))
static void dump_hash_table PARAMS ((FILE *, const char *, struct hash_table *))
static struct expr *lookup_expr PARAMS ((rtx, struct hash_table *))
static struct expr *lookup_set PARAMS ((unsigned int, rtx, struct hash_table *))
static struct expr *next_set PARAMS ((unsigned int, struct expr *))
static void compute_transp PARAMS ((rtx, int, sbitmap *, int))
static void
compute_local_properties 
PARAMS ((sbitmap *, sbitmap *, sbitmap *, struct hash_table *))
static void find_used_regs PARAMS ((rtx *, void *))
static int try_replace_reg PARAMS ((rtx, rtx, rtx))
static int cprop_jump PARAMS ((basic_block, rtx, rtx, rtx, rtx))
static int load_killed_in_block_p PARAMS ((basic_block, int, rtx, int))
static bool constprop_register PARAMS ((rtx, rtx, rtx, int))
static bool reg_killed_on_edge PARAMS ((rtx, edge))
static int bypass_block PARAMS ((basic_block, rtx, rtx))
static int pre_expr_reaches_here_p PARAMS ((basic_block, struct expr *, basic_block))
static void insert_insn_end_bb PARAMS ((struct expr *, basic_block, int))
static void pre_insert_copy_insn PARAMS ((struct expr *, rtx))
static int
hoist_expr_reaches_here_p 
PARAMS ((basic_block, int, basic_block, char *))
static void handle_rd_kill_set PARAMS ((rtx, int, basic_block))
static int expr_killed_p PARAMS ((rtx, basic_block))
static void compute_ae_kill PARAMS ((sbitmap *, sbitmap *, struct hash_table *))
static int expr_reaches_here_p PARAMS ((struct occr *, struct expr *, basic_block, int))
static int can_disregard_other_sets PARAMS ((struct reg_set **, rtx, int))
static int handle_avail_expr PARAMS ((rtx, struct expr *))
static int
delete_null_pointer_checks_1 
PARAMS ((unsigned int *, sbitmap *, sbitmap *, struct null_pointer_info *))
static rtx process_insert_insn PARAMS ((struct expr *))
static int pre_edge_insert PARAMS ((struct edge_list *, struct expr **))
static int expr_reaches_here_p_work PARAMS ((struct occr *, struct expr *, basic_block, int, char *))
static int
pre_expr_reaches_here_p_work 
PARAMS ((basic_block, struct expr *, basic_block, char *))
static void free_ldst_entry PARAMS ((struct ls_expr *))
static void print_ldst_list PARAMS ((FILE *))
static int store_killed_after PARAMS ((rtx, rtx, basic_block))
static int insert_store PARAMS ((struct ls_expr *, edge))
static void delete_store PARAMS ((struct ls_expr *, basic_block))
static void
free_insn_expr_list_list 
PARAMS ((rtx *))
static bool do_local_cprop PARAMS ((rtx, rtx, int, rtx *))
static bool adjust_libcall_notes PARAMS ((rtx, rtx, rtx, rtx *))
int gcse_main (rtx f, FILE *file)
static void compute_can_copy ()
static char * gmalloc (unsigned int size)
static char * grealloc (char *ptr, unsigned int size)
static char * gcse_alloc (unsigned long size)
static void alloc_gcse_mem (rtx f)
static void free_gcse_mem ()
static int get_bitmap_width (int n, int x, int y)
static void compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc, struct hash_table *table)
static void alloc_reg_set_mem (int n_regs)
static void free_reg_set_mem ()
static void record_one_set (int regno, rtx insn)
static void record_set_info (rtx dest, setter, void *data)
static void compute_sets (rtx f)
static GTY (())
static int oprs_unchanged_p (rtx x, rtx insn, int avail_p)
static void mems_conflict_for_gcse_p (rtx dest, setter, data)
static int load_killed_in_block_p (basic_block bb, int uid_limit, rtx x, int avail_p)
static int oprs_anticipatable_p (rtx x, rtx insn)
static int oprs_available_p (rtx x, rtx insn)
static unsigned int hash_expr (rtx x, enum machine_mode mode, int *do_not_record_p, int hash_table_size)
static unsigned hash_string_1 (char *ps) const
static unsigned int hash_expr_1 (rtx x, enum machine_mode mode, int *do_not_record_p)
static unsigned int hash_set (int regno, int hash_table_size)
static int expr_equiv_p (rtx x, rtx y)
static void insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p, int avail_p, struct hash_table *table)
static void insert_set_in_table (rtx x, rtx insn, struct hash_table *table)
static void hash_scan_set (rtx pat, rtx insn, struct hash_table *table)
static void hash_scan_clobber (x, insn, table)
static void hash_scan_call (x, insn, table)
static void hash_scan_insn (rtx insn, struct hash_table *table, int in_libcall_block)
static void dump_hash_table (FILE *file, const char *name, struct hash_table *table)
static void record_last_reg_set_info (rtx insn, int regno)
static void canon_list_insert (dest, unused1, void *v_insn)
static void record_last_mem_set_info (rtx insn)
static void record_last_set_info (rtx dest, setter, void *data)
static void compute_hash_table_work (struct hash_table *table)
static void alloc_hash_table (int n_insns, struct hash_table *table, int set_p)
static void free_hash_table (struct hash_table *table)
static void compute_hash_table (struct hash_table *table)
static struct exprlookup_expr (rtx pat, struct hash_table *table)
static struct exprlookup_set (unsigned int regno, rtx pat, struct hash_table *table)
static struct exprnext_set (unsigned int regno, struct expr *expr)
static void free_insn_expr_list_list (rtx *listp)
static void clear_modify_mem_tables ()
static void free_modify_mem_tables ()
static void reset_opr_set_tables ()
static int oprs_not_set_p (rtx x, rtx insn)
static void mark_call (rtx insn)
static void mark_set (rtx pat, rtx insn)
static void mark_clobber (rtx pat, rtx insn)
static void mark_oprs_set (rtx insn)
static void alloc_rd_mem (int n_blocks, int n_insns)
static void free_rd_mem ()
static void handle_rd_kill_set (rtx insn, int regno, basic_block bb)
static void compute_kill_rd ()
static void compute_rd ()
static void alloc_avail_expr_mem (int n_blocks, int n_exprs)
static void free_avail_expr_mem ()
static void compute_ae_gen (struct hash_table *expr_hash_table)
static int expr_killed_p (rtx x, basic_block bb)
static void compute_ae_kill (sbitmap *ae_gen, sbitmap *ae_kill, struct hash_table *expr_hash_table)
static int expr_reaches_here_p_work (struct occr *occr, struct expr *expr, basic_block bb, int check_self_loop, char *visited)
static int expr_reaches_here_p (struct occr *occr, struct expr *expr, basic_block bb, int check_self_loop)
static rtx computing_insn (struct expr *expr, rtx insn)
static int def_reaches_here_p (rtx insn, rtx def_insn)
static int can_disregard_other_sets (struct reg_set **addr_this_reg, rtx insn, int for_combine)
static int handle_avail_expr (rtx insn, struct expr *expr)
static int classic_gcse ()
static int one_classic_gcse_pass (int pass)
static void alloc_cprop_mem (int n_blocks, int n_sets)
static void free_cprop_mem ()
static void compute_transp (rtx x, int indx, sbitmap *bmap, int set_p)
static void compute_cprop_data ()
static void find_used_regs (rtx *xptr, data)
static int try_replace_reg (rtx from, rtx to, rtx insn)
static struct exprfind_avail_set (int regno, rtx insn)
static int cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src)
static bool constprop_register (rtx insn, rtx from, rtx to, int alter_jumps)
static int cprop_insn (rtx insn, int alter_jumps)
static void local_cprop_find_used_regs (rtx *xptr, void *data)
static bool do_local_cprop (rtx x, rtx insn, int alter_jumps, rtx *libcall_sp)
static bool adjust_libcall_notes (rtx oldreg, rtx newval, rtx insn, rtx *libcall_sp)
static void local_cprop_pass (int alter_jumps)
static int cprop (int alter_jumps)
static int one_cprop_pass (int pass, int alter_jumps)
static struct exprfind_bypass_set (int regno, int bb)
static bool reg_killed_on_edge (rtx reg, edge e)
static int bypass_block (basic_block bb, rtx setcc, rtx jump)
static int bypass_conditional_jumps ()
static void alloc_pre_mem (int n_blocks, int n_exprs)
static void free_pre_mem ()
static void compute_pre_data ()
static int pre_expr_reaches_here_p_work (basic_block occr_bb, struct expr *expr, basic_block bb, char *visited)
static int pre_expr_reaches_here_p (basic_block occr_bb, struct expr *expr, basic_block bb)
static rtx process_insert_insn (struct expr *expr)
static void insert_insn_end_bb (struct expr *expr, basic_block bb, int pre)
static int pre_edge_insert (struct edge_list *edge_list, struct expr **index_map)
static void pre_insert_copy_insn (struct expr *expr, rtx insn)
static void pre_insert_copies ()
static rtx gcse_emit_move_after (rtx src, rtx dest, rtx insn)
static int pre_delete ()
static int pre_gcse ()
static int one_pre_gcse_pass (int pass)
static void add_label_notes (rtx x, rtx insn)
static void compute_transpout ()
static void invalidate_nonnull_info (rtx x, setter, void *data)
static int delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin, sbitmap *nonnull_avout, struct null_pointer_info *npi)
int delete_null_pointer_checks (f)
static void alloc_code_hoist_mem (int n_blocks, int n_exprs)
static void free_code_hoist_mem ()
static void compute_code_hoist_vbeinout ()
static void compute_code_hoist_data ()
static int hoist_expr_reaches_here_p (basic_block expr_bb, int expr_index, basic_block bb, char *visited)
static void hoist_code ()
static int one_code_hoisting_pass ()
static struct ls_exprldst_entry (rtx x)
static void free_ldst_entry (struct ls_expr *ptr)
static void free_ldst_mems ()
static void print_ldst_list (FILE *file)
static struct ls_exprfind_rtx_in_ldst (rtx x)
static int enumerate_ldsts ()
static struct ls_exprfirst_ls_expr ()
static struct ls_exprnext_ls_expr (struct ls_expr *ptr)
static int simple_mem (rtx x)
static void invalidate_any_buried_refs (rtx x)
static void compute_ld_motion_mems ()
static void trim_ld_motion_mems ()
static void update_ld_motion_stores (struct expr *expr)
static void reg_set_info (rtx dest, setter, data)
static int store_ops_ok (rtx x, basic_block bb)
static void find_moveable_store (rtx insn)
static int compute_store_table ()
static int load_kills_store (rtx x, rtx store_pattern)
static int find_loads (rtx x, rtx store_pattern)
static int store_killed_in_insn (rtx x, rtx insn)
static int store_killed_after (rtx x, rtx insn, basic_block bb)
static int store_killed_before (rtx x, rtx insn, basic_block bb)
static void build_store_vectors ()
static void insert_insn_start_bb (rtx insn, basic_block bb)
static int insert_store (struct ls_expr *expr, edge e)
static void replace_store_insn (rtx reg, rtx del, basic_block bb)
static void delete_store (struct ls_expr *expr, basic_block bb)
static void free_store_memory ()
static void store_motion ()

Variables

static FILEgcse_file
static int run_jump_opt_after_gcse
static FILEdebug_stderr
static struct obstack gcse_obstack
static char can_copy_p [(int) NUM_MACHINE_MODES]
static int can_copy_init_p
static struct hash_table expr_hash_table
static struct hash_table set_hash_table
static int * uid_cuid
static int max_uid
static int max_cuid
static rtxcuid_insn
static unsigned int max_gcse_regno
static reg_set ** reg_set_table
static int reg_set_table_size
static struct ls_exprpre_ldst_mems = NULL
static regset reg_set_bitmap
static sbitmapreg_set_in_block
static rtxmodify_mem_list
bitmap modify_mem_list_set
static rtxcanon_modify_mem_list
bitmap canon_modify_mem_list_set
static int bytes_used
static int gcse_subst_count
static int gcse_create_count
static int const_prop_count
static int copy_prop_count
static sbitmaprd_kill
static sbitmaprd_gen
static sbitmapreaching_defs
static sbitmaprd_out
static sbitmapae_kill
static sbitmapae_gen
static sbitmapae_in
static sbitmapae_out
static struct obstack reg_set_obstack
static struct reg_avail_inforeg_avail_info
static basic_block current_bb
static int gcse_mems_conflict_p
static rtx gcse_mem_operand
static sbitmapcprop_pavloc
static sbitmapcprop_absaltered
static sbitmapcprop_avin
static sbitmapcprop_avout
static struct reg_use reg_use_table [MAX_USES]
static int reg_use_count
static sbitmaptransp
static sbitmaptranspout
static sbitmapcomp
static sbitmapantloc
static sbitmappre_optimal
static sbitmappre_redundant
static sbitmappre_insert_map
static sbitmappre_delete_map
static struct edge_listedge_list
static sbitmap pre_redundant_insns
static sbitmaphoist_vbein
static sbitmaphoist_vbeout
static sbitmaphoist_exprs
dominance_info dominators
static sbitmapregvec
static sbitmapst_antloc
static int num_stores


Define Documentation

#define ANTIC_STORE_LIST (  )     ((x)->loads)

#define AVAIL_STORE_LIST (  )     ((x)->stores)

#define CUID_INSN ( CUID   )     (cuid_insn[CUID])

Definition at line 408 of file gcse.c.

Referenced by alloc_gcse_mem(), and compute_kill_rd().

#define INSN_CUID ( INSN   )     (uid_cuid[INSN_UID (INSN)])

Definition at line 398 of file gcse.c.

#define MAX_NESTED_LIBCALLS   9

Definition at line 4435 of file gcse.c.

Referenced by local_cprop_pass().

#define MAX_USES   8

Definition at line 3856 of file gcse.c.

Referenced by find_used_regs().

#define REG_SET_TABLE_SLOP   100

Definition at line 454 of file gcse.c.

Referenced by alloc_reg_set_mem(), and record_one_set().


Function Documentation

static void add_label_notes ( rtx  x,
rtx  insn 
) [static]

static bool adjust_libcall_notes ( rtx  oldreg,
rtx  newval,
rtx  insn,
rtx libcall_sp 
) [static]

static void alloc_avail_expr_mem ( int  n_blocks,
int  n_exprs 
) [static]

Definition at line 3028 of file gcse.c.

References sbitmap_vector_alloc(), and sbitmap_vector_zero().

Referenced by one_classic_gcse_pass().

static void alloc_code_hoist_mem ( int  n_blocks,
int  n_exprs 
) [static]

Definition at line 6021 of file gcse.c.

References sbitmap_vector_alloc().

Referenced by one_code_hoisting_pass().

static void alloc_cprop_mem ( int  n_blocks,
int  n_sets 
) [static]

Definition at line 3683 of file gcse.c.

References sbitmap_vector_alloc().

Referenced by one_cprop_pass().

static void alloc_gcse_mem ( rtx  f  )  [static]

static void alloc_hash_table ( int  n_insns,
struct hash_table table,
int  set_p 
) [static]

static void alloc_pre_mem ( int  n_blocks,
int  n_exprs 
) [static]

Definition at line 4870 of file gcse.c.

References NULL, and sbitmap_vector_alloc().

Referenced by one_pre_gcse_pass().

static void alloc_rd_mem ( int  n_blocks,
int  n_insns 
) [static]

Definition at line 2897 of file gcse.c.

References sbitmap_vector_alloc(), and sbitmap_vector_zero().

Referenced by one_classic_gcse_pass().

static void alloc_reg_set_mem ( int  n_regs  )  [static]

static void build_store_vectors ( void   )  [static]

static int bypass_block ( basic_block  bb,
rtx  setcc,
rtx  jump 
) [static]

static int bypass_conditional_jumps ( void   )  [static]

static int can_disregard_other_sets ( struct reg_set **  addr_this_reg,
rtx  insn,
int  for_combine 
) [static]

Definition at line 3364 of file gcse.c.

References def_reaches_here_p(), GET_CODE, reg_set::insn, reg_set::next, PATTERN, rtx_equal_p(), and SET_SRC.

Referenced by handle_avail_expr().

static void canon_list_insert ( dest  ,
unused1  ,
void v_insn 
) [static]

static int classic_gcse (  )  [static]

static void clear_modify_mem_tables ( void   )  [static]

static void compute_ae_gen ( struct hash_table expr_hash_table  )  [static]

static void compute_ae_kill ( sbitmap ae_gen,
sbitmap ae_kill,
struct hash_table expr_hash_table 
) [static]

static void compute_can_copy ( void   )  [static]

static void compute_code_hoist_data ( void   )  [static]

static void compute_code_hoist_vbeinout ( void   )  [static]

static void compute_cprop_data ( void   )  [static]

Definition at line 3846 of file gcse.c.

References compute_available(), compute_local_properties(), NULL, and set_hash_table.

Referenced by one_cprop_pass().

static void compute_hash_table ( struct hash_table table  )  [static]

static void compute_hash_table_work ( struct hash_table table  )  [static]

static void compute_kill_rd (  )  [static]

static void compute_ld_motion_mems ( void   )  [static]

static void compute_local_properties ( sbitmap transp,
sbitmap comp,
sbitmap antloc,
struct hash_table table 
) [static]

static void compute_pre_data ( void   )  [static]

static void compute_rd (  )  [static]

static void compute_sets ( rtx  f  )  [static]

static int compute_store_table ( void   )  [static]

static void compute_transp ( rtx  x,
int  indx,
sbitmap bmap,
int  set_p 
) [static]

static void compute_transpout ( void   )  [static]

static rtx computing_insn ( struct expr expr,
rtx  insn 
) [static]

Definition at line 3262 of file gcse.c.

References abort, BLOCK_FOR_INSN, expr_reaches_here_p(), occr::insn, INSN_CUID, occr::next, and NULL.

Referenced by handle_avail_expr().

static bool constprop_register ( rtx  insn,
rtx  from,
rtx  to,
int  alter_jumps 
) [static]

static int cprop ( int  alter_jumps  )  [static]

static int cprop_insn ( rtx  insn,
int  alter_jumps 
) [static]

static int cprop_jump ( basic_block  bb,
rtx  setcc,
rtx  jump,
rtx  from,
rtx  src 
) [static]

static int def_reaches_here_p ( rtx  insn,
rtx  def_insn 
) [static]

Definition at line 3327 of file gcse.c.

References abort, BLOCK_NUM, GET_CODE, INSN_CUID, NEXT_INSN, PATTERN, reg_set_between_p(), SET, SET_DEST, TEST_BIT, and XEXP.

Referenced by can_disregard_other_sets().

int delete_null_pointer_checks ( f   ) 

static int delete_null_pointer_checks_1 ( unsigned int *  block_reg,
sbitmap nonnull_avin,
sbitmap nonnull_avout,
struct null_pointer_info npi 
) [static]

static void delete_store ( struct ls_expr expr,
basic_block  bb 
) [static]

Definition at line 7366 of file gcse.c.

References AVAIL_STORE_LIST, BLOCK_FOR_INSN, gen_reg_rtx(), GET_MODE, i, NULL_RTX, replace_store_insn(), and XEXP.

Referenced by store_motion().

static bool do_local_cprop ( rtx  x,
rtx  insn,
int  alter_jumps,
rtx libcall_sp 
) [static]

static void dump_hash_table ( FILE file,
const char *  name,
struct hash_table table 
) [static]

static int enumerate_ldsts ( void   )  [static]

Definition at line 6495 of file gcse.c.

References ls_expr::index, n, ls_expr::next, NULL, and ptr.

Referenced by compute_store_table().

static int expr_equiv_p ( rtx  x,
rtx  y 
) [static]

static int expr_killed_p ( rtx  x,
basic_block  bb 
) [static]

static int expr_reaches_here_p ( struct occr occr,
struct expr expr,
basic_block  bb,
int  check_self_loop 
) [static]

Definition at line 3241 of file gcse.c.

References expr_reaches_here_p_work(), free(), last_basic_block, visited, and xcalloc().

Referenced by computing_insn().

static int expr_reaches_here_p_work ( struct occr occr,
struct expr expr,
basic_block  bb,
int  check_self_loop,
char *  visited 
) [static]

static struct expr* find_avail_set ( int  regno,
rtx  insn 
) [static, read]

static struct expr* find_bypass_set ( int  regno,
int  bb 
) [static, read]

Definition at line 4596 of file gcse.c.

References abort, CONSTANT_P, GET_CODE, lookup_set(), next_set(), NULL_RTX, REG, REGNO, result, SET, set_hash_table, SET_SRC, src, and TEST_BIT.

Referenced by bypass_block().

static int find_loads ( rtx  x,
rtx  store_pattern 
) [static]

Definition at line 6993 of file gcse.c.

References GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, load_kills_store(), MEM, ret, SET, SET_SRC, XEXP, XVECEXP, and XVECLEN.

Referenced by find_loads(), and store_killed_in_insn().

static void find_moveable_store ( rtx  insn  )  [static]

static struct ls_expr* find_rtx_in_ldst ( rtx  x  )  [static, read]

static void find_used_regs ( rtx xptr,
data   
) [static]

static struct ls_expr* first_ls_expr ( void   )  [static, read]

static void free_avail_expr_mem (  )  [static]

Definition at line 3045 of file gcse.c.

References sbitmap_vector_free.

Referenced by one_classic_gcse_pass().

static void free_code_hoist_mem ( void   )  [static]

Definition at line 6037 of file gcse.c.

References free_dominance_info(), and sbitmap_vector_free.

Referenced by one_code_hoisting_pass().

static void free_cprop_mem ( void   )  [static]

Definition at line 3696 of file gcse.c.

References sbitmap_vector_free.

Referenced by one_cprop_pass().

static void free_gcse_mem ( void   )  [static]

static void free_hash_table ( struct hash_table table  )  [static]

Definition at line 2590 of file gcse.c.

References free().

Referenced by one_classic_gcse_pass(), one_code_hoisting_pass(), one_cprop_pass(), and one_pre_gcse_pass().

static void free_insn_expr_list_list ( rtx listp  )  [static]

Definition at line 2684 of file gcse.c.

References free_EXPR_LIST_node(), free_INSN_LIST_node(), GET_CODE, next, NULL, and XEXP.

Referenced by clear_modify_mem_tables().

static void free_ldst_entry ( struct ls_expr ptr  )  [static]

Definition at line 6415 of file gcse.c.

References free(), and free_INSN_LIST_list().

Referenced by compute_store_table(), free_ldst_mems(), and trim_ld_motion_mems().

static void free_ldst_mems ( void   )  [static]

Definition at line 6427 of file gcse.c.

References free_ldst_entry(), ls_expr::next, NULL, and tmp.

Referenced by free_store_memory(), and one_pre_gcse_pass().

static void free_modify_mem_tables ( void   )  [static]

Definition at line 2720 of file gcse.c.

References canon_modify_mem_list, clear_modify_mem_tables(), free(), and modify_mem_list.

Referenced by free_gcse_mem(), gcse_main(), and gmalloc().

static void free_pre_mem ( void   )  [static]

Definition at line 4891 of file gcse.c.

References NULL, and sbitmap_vector_free.

Referenced by one_pre_gcse_pass().

static void free_rd_mem (  )  [static]

Definition at line 2916 of file gcse.c.

References sbitmap_vector_free.

Referenced by one_classic_gcse_pass().

static void free_reg_set_mem ( void   )  [static]

Definition at line 1214 of file gcse.c.

References free(), NULL, obstack_free, and reg_set_obstack.

Referenced by bypass_jumps(), gcse_main(), gmalloc(), and local_cprop_pass().

static void free_store_memory ( void   )  [static]

Definition at line 7396 of file gcse.c.

References free_ldst_mems(), NULL, and sbitmap_vector_free.

Referenced by store_motion().

static char* gcse_alloc ( unsigned long  size  )  [static]

Definition at line 976 of file gcse.c.

References bytes_used, gcse_obstack, and obstack_alloc.

Referenced by gcse_main(), gmalloc(), insert_expr_in_table(), and insert_set_in_table().

static rtx gcse_emit_move_after ( rtx  src,
rtx  dest,
rtx  insn 
) [static]

int gcse_main ( rtx  f,
FILE file 
)

Definition at line 712 of file gcse.c.

Referenced by rest_of_compilation(), and rest_of_handle_gcse().

static int get_bitmap_width ( int  n,
int  x,
int  y 
) [static]

Definition at line 1071 of file gcse.c.

References SBITMAP_ELT_BITS, SBITMAP_ELT_TYPE, and SBITMAP_SET_SIZE.

Referenced by delete_null_pointer_checks().

static char* gmalloc ( unsigned int  size  )  [static]

Definition at line 954 of file gcse.c.

References bytes_used, and xmalloc().

Referenced by alloc_gcse_mem(), alloc_hash_table(), alloc_reg_set_mem(), compute_hash_table_work(), and gcse_main().

static char* grealloc ( char *  ptr,
unsigned int  size 
) [static]

Definition at line 966 of file gcse.c.

References xrealloc().

Referenced by record_one_set().

static GTY ( ()   )  [static]

static int handle_avail_expr ( rtx  insn,
struct expr expr 
) [static]

static void handle_rd_kill_set ( rtx  insn,
int  regno,
basic_block  bb 
) [static]

Definition at line 2927 of file gcse.c.

References BLOCK_NUM, basic_block_def::index, reg_set::insn, INSN_CUID, reg_set::next, and SET_BIT.

Referenced by compute_kill_rd().

static unsigned int hash_expr ( rtx  x,
enum machine_mode  mode,
int *  do_not_record_p,
int  hash_table_size 
) [static]

Definition at line 1558 of file gcse.c.

References hash_expr_1().

Referenced by insert_expr_in_table(), lookup_expr(), and lookup_expr_in_table().

static unsigned int hash_expr_1 ( rtx  x,
enum machine_mode  mode,
int *  do_not_record_p 
) [static]

static void hash_scan_call ( ,
insn  ,
table   
) [static]

Definition at line 2245 of file gcse.c.

Referenced by hash_scan_insn(), and hash_scan_set().

static void hash_scan_clobber ( ,
insn  ,
table   
) [static]

Definition at line 2237 of file gcse.c.

Referenced by hash_scan_insn().

static void hash_scan_insn ( rtx  insn,
struct hash_table table,
int  in_libcall_block 
) [static]

Definition at line 2266 of file gcse.c.

References GET_CODE, hash_scan_call(), hash_scan_clobber(), hash_scan_set(), i, PATTERN, SET, x, XVECEXP, and XVECLEN.

Referenced by compute_hash_table_work().

static void hash_scan_set ( rtx  pat,
rtx  insn,
struct hash_table table 
) [static]

static unsigned int hash_set ( int  regno,
int  hash_table_size 
) [static]

Definition at line 1782 of file gcse.c.

Referenced by insert_set_in_table(), and lookup_set().

static unsigned hash_string_1 ( char *  ps  )  const [inline, static]

Definition at line 1575 of file gcse.c.

References p.

Referenced by hash_expr_1().

static void hoist_code ( void   )  [static]

static int hoist_expr_reaches_here_p ( basic_block  expr_bb,
int  expr_index,
basic_block  bb,
char *  visited 
) [static]

static void insert_expr_in_table ( rtx  x,
enum machine_mode  mode,
rtx  insn,
int  antic_p,
int  avail_p,
struct hash_table table 
) [static]

static void insert_insn_end_bb ( struct expr expr,
basic_block  bb,
int  pre 
) [static]

static void insert_insn_start_bb ( rtx  insn,
basic_block  bb 
) [static]

static void insert_set_in_table ( rtx  x,
rtx  insn,
struct hash_table table 
) [static]

static int insert_store ( struct ls_expr expr,
edge  e 
) [static]

static void invalidate_any_buried_refs ( rtx  x  )  [static]

static void invalidate_nonnull_info ( rtx  x,
setter  ,
void data 
) [static]

static struct ls_expr* ldst_entry ( rtx  x  )  [static, read]

static int load_killed_in_block_p ( basic_block  bb,
int  uid_limit,
rtx  x,
int  avail_p 
) [static]

static int load_kills_store ( rtx  x,
rtx  store_pattern 
) [static]

Definition at line 6981 of file gcse.c.

References GET_MODE, rtx_addr_varies_p(), and true_dependence().

Referenced by find_loads().

static void local_cprop_find_used_regs ( rtx xptr,
void data 
) [static]

Definition at line 4273 of file gcse.c.

References BITS_PER_WORD, find_used_regs(), GET_CODE, GET_MODE, GET_MODE_BITSIZE, SUBREG_REG, and x.

Referenced by local_cprop_pass().

static void local_cprop_pass ( int  alter_jumps  )  [static]

static struct expr* lookup_expr ( rtx  pat,
struct hash_table table 
) [static, read]

static struct expr* lookup_set ( unsigned int  regno,
rtx  pat,
struct hash_table table 
) [static, read]

static void mark_call ( rtx  insn  )  [static]

Definition at line 2813 of file gcse.c.

References CONST_OR_PURE_CALL_P, and record_last_mem_set_info().

Referenced by compute_hash_table_work(), mark_oprs_set(), and mark_set().

static void mark_clobber ( rtx  pat,
rtx  insn 
) [static]

Definition at line 2846 of file gcse.c.

References GET_CODE, record_last_mem_set_info(), REG, reg_set_bitmap, REGNO, SET_REGNO_REG_SET, and XEXP.

Referenced by mark_oprs_set().

static void mark_oprs_set ( rtx  insn  )  [static]

Definition at line 2864 of file gcse.c.

References GET_CODE, i, mark_call(), mark_clobber(), mark_set(), PATTERN, SET, x, XVECEXP, and XVECLEN.

Referenced by classic_gcse(), and cprop().

static void mark_set ( rtx  pat,
rtx  insn 
) [static]

static void mems_conflict_for_gcse_p ( rtx  dest,
setter  ,
data   
) [static]

Definition at line 1446 of file gcse.c.

References find_rtx_in_ldst(), GET_CODE, GET_MODE, MEM, NULL, rtx_addr_varies_p(), true_dependence(), and XEXP.

Referenced by load_killed_in_block_p().

static struct ls_expr* next_ls_expr ( struct ls_expr ptr  )  [static, read]

static struct expr* next_set ( unsigned int  regno,
struct expr expr 
) [static, read]

Definition at line 2669 of file gcse.c.

References expr::expr, expr::next_same_hash, REGNO, and SET_DEST.

Referenced by find_avail_set(), and find_bypass_set().

static int one_classic_gcse_pass ( int  pass  )  [static]

static int one_code_hoisting_pass ( void   )  [static]

static int one_cprop_pass ( int  pass,
int  alter_jumps 
) [static]

static int one_pre_gcse_pass ( int  pass  )  [static]

static int oprs_anticipatable_p ( rtx  x,
rtx  insn 
) [static]

Definition at line 1533 of file gcse.c.

References oprs_unchanged_p().

Referenced by hash_scan_set().

static int oprs_available_p ( rtx  x,
rtx  insn 
) [static]

Definition at line 1543 of file gcse.c.

References oprs_unchanged_p().

Referenced by hash_scan_set().

static int oprs_not_set_p ( rtx  x,
rtx  insn 
) [static]

static int oprs_unchanged_p ( rtx  x,
rtx  insn,
int  avail_p 
) [static]

static bool adjust_libcall_notes PARAMS ( (rtx, rtx, rtx, rtx *)   )  [static]

static bool do_local_cprop PARAMS ( (rtx, rtx, int, rtx *)   )  [static]

static void free_insn_expr_list_list PARAMS ( (rtx *)   )  [static]

static void delete_store PARAMS ( (struct ls_expr *, basic_block  )  [static]

static int insert_store PARAMS ( (struct ls_expr *, edge  )  [static]

static int store_killed_after PARAMS ( (rtx, rtx, basic_block  )  [static]

static void print_ldst_list PARAMS ( (FILE *)   )  [static]

static void free_ldst_entry PARAMS ( (struct ls_expr *)   )  [static]

static int pre_expr_reaches_here_p_work PARAMS ( (basic_block, struct expr *, basic_block, char *)   )  [static]

static int expr_reaches_here_p_work PARAMS ( (struct occr *, struct expr *, basic_block, int, char *)   )  [static]

static int pre_edge_insert PARAMS ( (struct edge_list *, struct expr **)   )  [static]

static rtx process_insert_insn PARAMS ( (struct expr *)   )  [static]

static int delete_null_pointer_checks_1 PARAMS ( (unsigned int *, sbitmap *, sbitmap *, struct null_pointer_info *)   )  [static]

static int handle_avail_expr PARAMS ( (rtx, struct expr *)   )  [static]

static int can_disregard_other_sets PARAMS ( (struct reg_set **, rtx, int)   )  [static]

static int expr_reaches_here_p PARAMS ( (struct occr *, struct expr *, basic_block, int)   )  [static]

static void compute_ae_kill PARAMS ( (sbitmap *, sbitmap *, struct hash_table *)   )  [static]

static int expr_killed_p PARAMS ( (rtx, basic_block  )  [static]

static void handle_rd_kill_set PARAMS ( (rtx, int, basic_block  )  [static]

static int hoist_expr_reaches_here_p PARAMS ( (basic_block, int, basic_block, char *)   )  [static]

static void pre_insert_copy_insn PARAMS ( (struct expr *, rtx  )  [static]

static void insert_insn_end_bb PARAMS ( (struct expr *, basic_block, int)   )  [static]

static int pre_expr_reaches_here_p PARAMS ( (basic_block, struct expr *, basic_block  )  [static]

static int bypass_block PARAMS ( (basic_block, rtx, rtx  )  [static]

static bool reg_killed_on_edge PARAMS ( (rtx, edge  )  [static]

static bool constprop_register PARAMS ( (rtx, rtx, rtx, int)   )  [static]

static int load_killed_in_block_p PARAMS ( (basic_block, int, rtx, int)   )  [static]

static int cprop_jump PARAMS ( (basic_block, rtx, rtx, rtx, rtx  )  [static]

static int try_replace_reg PARAMS ( (rtx, rtx, rtx  )  [static]

static void find_used_regs PARAMS ( (rtx *, void *)   )  [static]

static void compute_local_properties PARAMS ( (sbitmap *, sbitmap *, sbitmap *, struct hash_table *)   )  [static]

static void compute_transp PARAMS ( (rtx, int, sbitmap *, int)   )  [static]

static struct expr* next_set PARAMS ( (unsigned int, struct expr *)   )  [static, read]

static struct expr* lookup_set PARAMS ( (unsigned int, rtx, struct hash_table *)   )  [static, read]

static struct expr* lookup_expr PARAMS ( (rtx, struct hash_table *)   )  [static, read]

static void dump_hash_table PARAMS ( (FILE *, const char *, struct hash_table *)   )  [static]

static void alloc_hash_table PARAMS ( (int, struct hash_table *, int)   )  [static]

static void compute_hash_table PARAMS ( (struct hash_table *)   )  [static]

static void record_last_reg_set_info PARAMS ( (rtx, int)   )  [static]

static unsigned int hash_set PARAMS ( (int, int)   )  [static]

static unsigned int hash_string_1 PARAMS ( (const char *)   )  [static]

Definition at line 635 of file mips-tfile.c.

static unsigned int hash_expr_1 PARAMS ( (rtx, enum machine_mode, int *)   )  [static]

static unsigned int hash_expr PARAMS ( (rtx, enum machine_mode, int *, int)   )  [static]

static void insert_expr_in_table PARAMS ( (rtx, enum machine_mode, rtx, int, int, struct hash_table *)   )  [static]

static int oprs_anticipatable_p PARAMS ( (rtx, rtx  )  [static]

static int oprs_unchanged_p PARAMS ( (rtx, rtx, int)   )  [static]

static void hash_scan_set PARAMS ( (rtx, rtx, struct hash_table *)   )  [static]

static void hash_scan_insn PARAMS ( (rtx, struct hash_table *, int)   )  [static]

static void record_set_info PARAMS ( (rtx, rtx, void *)   )  [static]

static void record_one_set PARAMS ( (int, rtx  )  [static]

static int get_bitmap_width PARAMS ( (int, int, int)   )  [static]

static void alloc_reg_set_mem PARAMS ( (int)   )  [static]

static void alloc_gcse_mem PARAMS ( (rtx  )  [static]

static char* gcse_alloc PARAMS ( (unsigned long  )  [static]

static char* grealloc PARAMS ( (char *, unsigned int)   )  [static]

static char* gmalloc PARAMS ( (unsigned int)   )  [static]

static void compute_can_copy PARAMS ( (void  )  [static, read]

Definition at line 77 of file cplus-dem.c.

static int pre_delete ( void   )  [static]

static int pre_edge_insert ( struct edge_list edge_list,
struct expr **  index_map 
) [static]

static int pre_expr_reaches_here_p ( basic_block  occr_bb,
struct expr expr,
basic_block  bb 
) [static]

Definition at line 5039 of file gcse.c.

References free(), last_basic_block, pre_expr_reaches_here_p_work(), visited, and xcalloc().

Referenced by pre_insert_copies().

static int pre_expr_reaches_here_p_work ( basic_block  occr_bb,
struct expr expr,
basic_block  bb,
char *  visited 
) [static]

static int pre_gcse ( void   )  [static]

static void pre_insert_copies ( void   )  [static]

static void pre_insert_copy_insn ( struct expr expr,
rtx  insn 
) [static]

static void print_ldst_list ( FILE file  )  [static]

static rtx process_insert_insn ( struct expr expr  )  [static]

static void record_last_mem_set_info ( rtx  insn  )  [static]

static void record_last_reg_set_info ( rtx  insn,
int  regno 
) [static]

static void record_last_set_info ( rtx  dest,
setter  ,
void data 
) [static]

static void record_one_set ( int  regno,
rtx  insn 
) [static]

static void record_set_info ( rtx  dest,
setter  ,
void data 
) [static]

Definition at line 1256 of file gcse.c.

References FIRST_PSEUDO_REGISTER, GET_CODE, record_one_set(), REG, and REGNO.

Referenced by compute_sets(), and insert_insn_end_bb().

static bool reg_killed_on_edge ( rtx  reg,
edge  e 
) [static]

Definition at line 4640 of file gcse.c.

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

Referenced by bypass_block(), and eliminate_partially_redundant_load().

static void reg_set_info ( rtx  dest,
setter  ,
data   
) [static]

Definition at line 6785 of file gcse.c.

References GET_CODE, REG, REGNO, SET_BIT, and SUBREG_REG.

Referenced by compute_store_table().

static void replace_store_insn ( rtx  reg,
rtx  del,
basic_block  bb 
) [static]

static void reset_opr_set_tables ( void   )  [static]

static int simple_mem ( rtx  x  )  [static]

Definition at line 6530 of file gcse.c.

References GET_CODE, GET_MODE, MEM, MEM_VOLATILE_P, rtx_varies_p(), and XEXP.

Referenced by compute_ld_motion_mems(), and invalidate_any_buried_refs().

static int store_killed_after ( rtx  x,
rtx  insn,
basic_block  bb 
) [static]

static int store_killed_before ( rtx  x,
rtx  insn,
basic_block  bb 
) [static]

static int store_killed_in_insn ( rtx  x,
rtx  insn 
) [static]

static void store_motion ( void   )  [static]

static int store_ops_ok ( rtx  x,
basic_block  bb 
) [static]

static void trim_ld_motion_mems ( void   )  [static]

static int try_replace_reg ( rtx  from,
rtx  to,
rtx  insn 
) [static]

static void update_ld_motion_stores ( struct expr expr  )  [static]


Variable Documentation

sbitmap * ae_gen [static]

Definition at line 537 of file gcse.c.

sbitmap * ae_in [static]

Definition at line 537 of file gcse.c.

sbitmap* ae_kill [static]

Definition at line 537 of file gcse.c.

sbitmap * ae_out [static]

Definition at line 537 of file gcse.c.

sbitmap* antloc [static]

Definition at line 4846 of file gcse.c.

int bytes_used [static]

int can_copy_init_p [static]

Definition at line 306 of file gcse.c.

Referenced by can_copy_p(), and gcse_main().

char can_copy_p[(int) NUM_MACHINE_MODES] [static]

Definition at line 303 of file gcse.c.

Referenced by compute_can_copy(), hash_scan_set(), may_assign_reg_p(), and scan_loop().

sbitmap* comp [static]

int const_prop_count [static]

Definition at line 515 of file gcse.c.

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

int copy_prop_count [static]

Definition at line 517 of file gcse.c.

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

Definition at line 3673 of file gcse.c.

sbitmap* cprop_avin [static]

Definition at line 3676 of file gcse.c.

sbitmap* cprop_avout [static]

Definition at line 3677 of file gcse.c.

sbitmap* cprop_pavloc [static]

Definition at line 3672 of file gcse.c.

rtx* cuid_insn [static]

Definition at line 405 of file gcse.c.

Referenced by alloc_gcse_mem(), and free_gcse_mem().

FILE* debug_stderr [static]

Definition at line 295 of file gcse.c.

Referenced by bypass_jumps(), gcse_main(), and gmalloc().

Definition at line 6009 of file gcse.c.

Definition at line 4862 of file gcse.c.

int gcse_create_count [static]

FILE* gcse_file [static]

Definition at line 1439 of file gcse.c.

int gcse_mems_conflict_p [static]

Definition at line 1433 of file gcse.c.

Definition at line 298 of file gcse.c.

Referenced by bypass_jumps(), gcse_alloc(), gcse_main(), and gmalloc().

int gcse_subst_count [static]

Definition at line 511 of file gcse.c.

Referenced by handle_avail_expr(), one_classic_gcse_pass(), one_pre_gcse_pass(), and pre_delete().

sbitmap* hoist_exprs [static]

Definition at line 6006 of file gcse.c.

sbitmap* hoist_vbein [static]

Definition at line 6002 of file gcse.c.

sbitmap* hoist_vbeout [static]

Definition at line 6003 of file gcse.c.

int max_cuid [static]

unsigned int max_gcse_regno [static]

int max_uid [static]

Definition at line 392 of file gcse.c.

rtx* modify_mem_list [static]

int num_stores [static]

Definition at line 6780 of file gcse.c.

Definition at line 4859 of file gcse.c.

Definition at line 4856 of file gcse.c.

struct ls_expr* pre_ldst_mems = NULL [static]

Definition at line 481 of file gcse.c.

sbitmap* pre_optimal [static]

Definition at line 4850 of file gcse.c.

Definition at line 4853 of file gcse.c.

Definition at line 4865 of file gcse.c.

sbitmap * rd_gen [static]

Definition at line 534 of file gcse.c.

sbitmap* rd_kill [static]

Definition at line 534 of file gcse.c.

sbitmap * rd_out [static]

Definition at line 534 of file gcse.c.

sbitmap * reaching_defs [static]

Definition at line 534 of file gcse.c.

Referenced by link_btr_uses().

Definition at line 1291 of file gcse.c.

Definition at line 493 of file gcse.c.

Definition at line 1197 of file gcse.c.

Referenced by alloc_reg_set_mem(), free_reg_set_mem(), and record_one_set().

reg_set** reg_set_table [static]

Definition at line 446 of file gcse.c.

int reg_set_table_size [static]

Definition at line 451 of file gcse.c.

Referenced by alloc_reg_set_mem(), and record_one_set().

int reg_use_count [static]

Definition at line 3863 of file gcse.c.

struct reg_use reg_use_table[MAX_USES] [static]

Definition at line 3860 of file gcse.c.

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

sbitmap* regvec [static]

Definition at line 6774 of file gcse.c.

Definition at line 288 of file gcse.c.

Referenced by cprop_jump(), gcse_main(), and gmalloc().

Definition at line 385 of file gcse.c.

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

sbitmap* st_antloc [static]

Definition at line 6777 of file gcse.c.

sbitmap* transp [static]

Definition at line 4835 of file gcse.c.

sbitmap* transpout [static]

Definition at line 4840 of file gcse.c.

int* uid_cuid [static]

Definition at line 389 of file gcse.c.


Generated on Wed Apr 8 15:33:14 2009 for Open64 by  doxygen 1.5.6