GCC Middle and Back End API Reference
tree-ssa-live.h File Reference

Go to the source code of this file.

Data Structures

struct  _var_map
struct  tree_live_info_d

Typedefs

typedef struct _var_mapvar_map
typedef struct tree_live_info_dtree_live_info_p

Functions

var_map init_var_map (int)
void delete_var_map (var_map)
int var_union (var_map, tree, tree)
void partition_view_normal (var_map, bool)
void partition_view_bitmap (var_map, bitmap, bool)
void dump_scope_blocks (FILE *, int)
void debug_scope_block (tree, int)
void debug_scope_blocks (int)
void remove_unused_locals (void)
void dump_var_map (FILE *, var_map)
void debug (_var_map &ref)
void debug (_var_map *ptr)
void register_ssa_partition_check (tree ssa_var)
static unsigned num_var_partitions ()
static tree partition_to_var ()
static tree version_to_var ()
static int var_to_partition ()
static tree var_to_partition_to_var ()
static int basevar_index ()
static int num_basevars ()
static void register_ssa_partition (var_map map, tree ssa_var)
void delete_tree_live_info (tree_live_info_p)
void calculate_live_on_exit (tree_live_info_p)
tree_live_info_p calculate_live_ranges (var_map)
void debug (tree_live_info_d &ref)
void debug (tree_live_info_d *ptr)
void dump_live_info (FILE *, tree_live_info_p, int)
static int partition_is_global ()
static bitmap live_on_entry ()
static bitmap live_on_exit ()
static var_map live_var_map ()
static void live_merge_and_clear ()
static void make_live_on_entry ()

Typedef Documentation

    ---------------- live on entry/exit info ------------------------------

    This structure is used to represent live range information on SSA based
    trees. A partition map must be provided, and based on the active partitions,
    live-on-entry information and live-on-exit information can be calculated.
    As well, partitions are marked as to whether they are global (live
    outside the basic block they are defined in).

    The live-on-entry information is per block.  It provide a bitmap for
    each block which has a bit set for each partition that is live on entry to
    that block.

    The live-on-exit information is per block.  It provides a bitmap for each
    block indicating which partitions are live on exit from the block.

    For the purposes of this implementation, we treat the elements of a PHI
    as follows:

       Uses in a PHI are considered LIVE-ON-EXIT to the block from which they
       originate. They are *NOT* considered live on entry to the block
       containing the PHI node.

       The Def of a PHI node is *not* considered live on entry to the block.
       It is considered to be "define early" in the block. Picture it as each
       block having a stmt (or block-preheader) before the first real stmt in
       the block which defines all the variables that are defined by PHIs.

    -----------------------------------------------------------------------  
typedef struct _var_map * var_map
   Used to create the variable mapping when we go out of SSA form.

   Mapping from an ssa_name to a partition number is maintained, as well as
   partition number back to ssa_name.

   This data structure also supports "views", which work on a subset of all
   partitions.  This allows the coalescer to decide what partitions are
   interesting to it, and only work with those partitions.  Whenever the view
   is changed, the partition numbers change, but none of the partition groupings
   change. (ie, it is truly a view since it doesn't change anything)

   The final component of the data structure is the basevar map.  This provides
   a list of all the different base variables which occur in a partition view,
   and a unique index for each one. Routines are provided to quickly produce
   the base variable of a partition.

   Note that members of a partition MUST all have the same base variable.  

Function Documentation

static int basevar_index ( )
inlinestatic
   Return the index into the basevar table for PARTITION's base in MAP.  

References register_ssa_partition_check().

Referenced by live_track_remove_partition(), and new_live_track().

void calculate_live_on_exit ( tree_live_info_p  )
tree_live_info_p calculate_live_ranges ( var_map  )
void debug ( _var_map ref)
void debug ( _var_map ptr)
void debug ( tree_live_info_d ref)
void debug ( tree_live_info_d ptr)
void debug_scope_block ( tree  ,
int   
)
void debug_scope_blocks ( int  )
void delete_tree_live_info ( tree_live_info_p  )
void delete_var_map ( var_map  )
void dump_live_info ( FILE *  ,
tree_live_info_p  ,
int   
)
void dump_scope_blocks ( FILE *  ,
int   
)
void dump_var_map ( FILE *  ,
var_map   
)
var_map init_var_map ( int  )
static void live_merge_and_clear ( )
inlinestatic
   Merge the live on entry information in LIVE for partitions P1 and P2. Place
   the result into P1.  Clear P2.  
static bitmap live_on_entry ( )
inlinestatic
   Return the bitmap from LIVE representing the live on entry blocks for
   partition P.  

References tree_live_info_d::map.

Referenced by dump_live_info(), and set_var_live_on_entry().

static bitmap live_on_exit ( )
inlinestatic
   Return the bitmap from LIVE representing the live on exit partitions from
   block BB.  
static var_map live_var_map ( )
inlinestatic
   Return the partition map which the information in LIVE utilizes.  
static void make_live_on_entry ( )
inlinestatic
   Mark partition P as live on entry to basic block BB in LIVE.  
static int num_basevars ( )
inlinestatic
   Return the number of different base variables in MAP.  
static unsigned num_var_partitions ( )
inlinestatic
   Return number of partitions in MAP.  

References _var_map::var_partition, and _var_map::view_to_partition.

Referenced by coalesce_partitions(), dump_live_info(), and var_to_partition_to_var().

static int partition_is_global ( )
inlinestatic
    Return TRUE if P is marked as a global in LIVE.  

References basic_block_def::index, and tree_live_info_d::liveout.

static tree partition_to_var ( )
inlinestatic
   Given partition index I from MAP, return the variable which represents that
   partition.  

References _var_map::partition_to_view, and _var_map::var_partition.

Referenced by calculate_live_on_exit(), dump_live_info(), dump_var_map(), elim_unvisited_predecessor(), insert_rtx_to_part_on_edge(), and var_to_partition().

void partition_view_bitmap ( var_map  ,
bitmap  ,
bool   
)
void partition_view_normal ( var_map  ,
bool   
)
static void register_ssa_partition ( var_map  map,
tree  ssa_var 
)
inlinestatic
   This routine registers a partition for SSA_VAR with MAP.  Any unregistered
   partitions may be filtered out by a view later.  

References tree_live_info_d::global, tree_live_info_d::livein, tree_live_info_d::liveout, tree_live_info_d::map, and tree_live_info_d::num_blocks.

void register_ssa_partition_check ( tree  ssa_var)
void remove_unused_locals ( void  )
   Remove local variables that are not referenced in the IL.  
     Removing declarations from lexical blocks when not optimizing is
     not only a waste of time, it actually causes differences in stack
     layout.  
     Walk the CFG marking all referenced symbols.  
         Walk the statements.  
     We do a two-pass approach about the out-of-scope clobbers.  We want
     to remove them if they are the only references to a local variable,
     but we want to retain them when there's any other.  So the first pass
     ignores them, and the second pass (if there were any) tries to remove
     them.  
                   Remove clobbers referencing unused vars, or clobbers
                   with MEM_REF lhs referencing uninitialized pointers.  
     Remove unmarked local and global vars from local_decls.  
                 Release any default def associated with var.  
static int var_to_partition ( )
inlinestatic
   Given VAR, return the partition number in MAP which contains it.
   NO_PARTITION is returned if it's not in any partition.  

References partition_to_var().

Referenced by add_dependence(), eliminate_useless_phis(), loe_visit_block(), and set_var_live_on_entry().

static tree var_to_partition_to_var ( )
inlinestatic
   Given VAR, return the variable which represents the entire partition
   it is a member of in MAP.  NULL is returned if it is not in a partition.  

References num_var_partitions(), and _var_map::partition_to_base_index.

Referenced by eliminate_useless_phis().

int var_union ( var_map  ,
tree  ,
tree   
)
static tree version_to_var ( )
inlinestatic
   Given ssa_name VERSION, if it has a partition in MAP,  return the var it
   is associated with.  Otherwise return NULL.  

References _var_map::partition_to_view, and _var_map::var_partition.