osprey/be/cg/gra_live.cxx File Reference

#include "defs.h"
#include "tracing.h"
#include "errors.h"
#include "mempool.h"
#include "cxx_memory.h"
#include "bitset.h"
#include "cgir.h"
#include "data_layout.h"
#include "calls.h"
#include "tn_set.h"
#include "tn_list.h"
#include "gtn_universe.h"
#include "gtn_set.h"
#include "gtn_tn_set.h"
#include "bb_list.h"
#include "bb_set.h"
#include "register.h"
#include "bbregs.h"
#include "gra_live.h"
#include "region_util.h"
#include "cg_region.h"
#include "cg_flags.h"
#include "tn_map.h"
#include "cg.h"
#include "cg_internal.h"
#include "whirl2ops.h"
#include "reg_live.h"
#include "cg_loop.h"
#include "pqs_cg.h"
#include "cgtarget.h"
#include "eh_region.h"

Include dependency graph for gra_live.cxx:

Go to the source code of this file.

Data Types

type  TN_BB_LIST_MAP

Defines

#define BB_visited_mark(bb)   (bb_visited_mark[BB_id(bb)])
#define TN_BB_LIST_MAP_tn_bbs_size(x)   ((x)->tn_bbs_size)
#define TN_BB_LIST_MAP_tn_bbs(x)   ((x)->tn_bbs)
#define TN_BB_LIST_MAP_tns_with_bbs(x)   ((x)->tns_with_bbs)
#define TN_is_local_reg(r)   (!(TN_is_dedicated(r) | TN_is_global_reg(r)))

Functions/Subroutines

static TN_BB_LIST_MAPTN_BB_LIST_MAP_Create (void)
static BB_LISTTN_BB_LIST_MAP_TN_To_BB_LIST (TN_BB_LIST_MAP *map, TN *tn)
static void TN_BB_LIST_MAP_Add (TN_BB_LIST_MAP *map, TN *tn, BB *bb)
static void TN_BB_LIST_MAP_Process_Pairs (TN_BB_LIST_MAP *map, void(*union1_fn)(BB *, TN *))
static void Check_TN_BB_LIST_MAPs_Allocated (void)
static void Deallocate_TN_BB_LIST_MAPs (void)
static void BB_Live_Def_Union1 (BB *bb, TN *tn)
static void BB_Live_Use_Union1 (BB *bb, TN *tn)
static void Distribute_TN_BB_LIST_MAPs (void)
static void Union1D_BB_Defreach_In (TN *tn, BB *bb)
static void Union1D_BB_Live_Out (TN *tn, BB *bb)
static void GRA_LIVE_Initialize_Memory (void)
static void GRA_LIVE_Finalize_Memory (void)
void Force_Live_Add (TN *tn)
void Force_Live_Remove (TN *tn)
static void Compute_Force_TNs (void)
void GRA_LIVE_Print_Liveness (BB *bb)
void GRA_LIVE_fdump_liveness (FILE *f)
void GRA_LIVE_dump_liveness (void)
static void GRA_LIVE_Init_BB_Start (BB *bb)
static void GRA_LIVE_Init_BB_End (BB *bb)
static void Localize_TNs_For_BB (BB *bb)
static void Detect_GTNs (void)
static void Detect_Multiply_Defined_GTNs (GTN_SET *multiple_defined_set, MEM_POOL *pool)
void GRA_LIVE_Detect_GTNs_In_Set (BB_SET *bbs)
static void GRA_LIVE_Localize_TNs (void)
static void Update_Local_Liveness_Info (void)
static void GRA_LIVE_Set_Entries_Exits (RID *rid)
static void Region_Boundary_Fixup (void)
static void Live_Init (BB *bb)
void GRA_LIVE_Local_Live_Propagate (BB *bb)
void GRA_LIVE_Local_Live_Propagate2 (BB *pred, BB *succ)
static void Live_Propagate (BB *bb)
static void Defreach_Propagate (BB *bb)
static void BB_Forward_Depth_First_Visit (BB *bb, BB_SET *border_bb_set, void(*pre_visit_func)(BB *bb), void(*post_visit_func)(BB *bb))
static void Do_Nothing (BB *bb)
static void BB_Forward_Depth_First (BB_LIST *start_bb_list, BB_SET *border_bb_set, void(*pre_visit_func)(BB *bb), void(*post_visit_func)(BB *bb))
void GRA_LIVE_Region_Compute_Global_Live_Info (void)
void GRA_LIVE_Region_Start (void)
void GRA_LIVE_Region_Entry (BB *bb)
void GRA_LIVE_Region_Exit (BB *bb)
static void BB_REGION_Forward_Depth_First_Visit_BB (BB *bb, BB_VISITED_COUNTER *counter, void(*pre_visit_func)(BB *bb), void(*post_visit_func)(BB *bb))
static void BB_REGION_Forward_Depth_First_Visit (const BB_REGION &region, BB_VISITED_COUNTER *counter, void(*pre_visit_func)(BB *bb), void(*post_visit_func)(BB *bb))
void BB_REGION_Recompute_Global_Live_Info (const BB_REGION &region, BOOL recompute_local_info)
void GRA_LIVE_Add_Live_In_GTN (BB *bb, TN *tn)
void GRA_LIVE_Remove_Live_In_GTN (BB *bb, TN *tn)
void GRA_LIVE_Add_Live_Out_GTN (BB *bb, TN *tn)
void GRA_LIVE_Remove_Live_Out_GTN (BB *bb, TN *tn)
void GRA_LIVE_Add_Defreach_In_GTN (BB *bb, TN *tn)
void GRA_LIVE_Remove_Defreach_In_GTN (BB *bb, TN *tn)
void GRA_LIVE_Add_Defreach_Out_GTN (BB *bb, TN *tn)
void GRA_LIVE_Remove_Defreach_Out_GTN (BB *bb, TN *tn)
void GRA_LIVE_Add_Live_Use_GTN (BB *bb, TN *tn)
void GRA_LIVE_Remove_Live_Use_GTN (BB *bb, TN *tn)
void GRA_LIVE_Add_Live_Def_GTN (BB *bb, TN *tn)
void GRA_LIVE_Remove_Live_Def_GTN (BB *bb, TN *tn)
void GRA_LIVE_Merge_Blocks (BB *dst, BB *a, BB *b)
void GRA_LIVE_Compute_Liveness_For_BB (BB *bb)
void GRA_LIVE_Init (RID *rid)
void GRA_LIVE_Recalc_Liveness (RID *rid)
void GRA_LIVE_Finish_PU (void)
void GRA_LIVE_Finish_REGION (void)
void GRA_LIVE_Init_Loop (BB *pbb, BB *bbb, BB *ebb, CG_LOOP_BACKPATCH *pbp, CG_LOOP_BACKPATCH *ebp)
void GRA_LIVE_Fini_Loop ()
static PQS_TN_SETget_usedef_set (TN_MAP map, TN *tn)
void GRA_LIVE_Compute_Local_Info (BB *bb)
BOOL GRA_LIVE_TN_Live_Outof_BB (TN *tn, BB *bb)
BOOL GRA_LIVE_TN_Live_Into_BB (TN *tn, BB *bb)
static void Rename_TN_In_Range (TN *tn, OP *op1, OP *op2)
static void Clear_Defreach (BB *bb)
void Rename_TNs_For_BB (BB *bb, GTN_SET *multiple_defined_set)
void GRA_LIVE_Rename_TNs (void)

Variables

static BB_LISTregion_entry_list
static BB_SET * region_exit_set
static MEM_POOL gra_live_pool
static MEM_POOL gra_live_local_pool
static MEM_POOL tn_bb_list_map_pool
static BOOL gra_live_pools_initialized = FALSE
static BOOL change
static MEM_POOL liveness_pool
static BOOL liveness_pool_initialized = FALSE
static BB_LISTnew_bbs
static TN_SET * tmp_live_use
static TN_SET * tmp_live_def
GTN_SET * force_live_gtns
static RIDgra_live_scope_rid
static UINT32 visited_mark
static UINT32bb_visited_mark
static BOOL tn_bb_list_maps_allocated
static TN_BB_LIST_MAPtn_live_use_bbs_map
static TN_BB_LIST_MAPtn_live_def_bbs_map
static BBprolog_bb
static BBbody_bb
static BBepilog_bb
static CG_LOOP_BACKPATCHprolog_bp
static CG_LOOP_BACKPATCHepilog_bp
static TNdefreach_tn


Define Documentation

#define BB_visited_mark ( bb   )     (bb_visited_mark[BB_id(bb)])

Definition at line 134 of file gra_live.cxx.

Referenced by BB_Forward_Depth_First(), and BB_Forward_Depth_First_Visit().

#define TN_BB_LIST_MAP_tn_bbs (  )     ((x)->tn_bbs)

Definition at line 154 of file gra_live.cxx.

Referenced by TN_BB_LIST_MAP_Add(), and TN_BB_LIST_MAP_TN_To_BB_LIST().

#define TN_BB_LIST_MAP_tn_bbs_size (  )     ((x)->tn_bbs_size)

Definition at line 153 of file gra_live.cxx.

Referenced by TN_BB_LIST_MAP_Add(), and TN_BB_LIST_MAP_TN_To_BB_LIST().

#define TN_BB_LIST_MAP_tns_with_bbs (  )     ((x)->tns_with_bbs)

Definition at line 155 of file gra_live.cxx.

Referenced by TN_BB_LIST_MAP_Add(), and TN_BB_LIST_MAP_Process_Pairs().

#define TN_is_local_reg (  )     (!(TN_is_dedicated(r) | TN_is_global_reg(r)))


Function Documentation

static void BB_Forward_Depth_First ( BB_LIST start_bb_list,
BB_SET *  border_bb_set,
void(*)(BB *bb pre_visit_func,
void(*)(BB *bb post_visit_func 
) [static]

static void BB_Forward_Depth_First_Visit ( BB bb,
BB_SET *  border_bb_set,
void(*)(BB *bb pre_visit_func,
void(*)(BB *bb post_visit_func 
) [static]

Definition at line 1492 of file gra_live.cxx.

References BB_visited_mark, BBLIST_item, FOR_ALL_BB_SUCCS, and visited_mark.

Referenced by BB_Forward_Depth_First().

static void BB_Live_Def_Union1 ( BB bb,
TN tn 
) [static]

Definition at line 395 of file gra_live.cxx.

References BB_live_def, FmtAssert, TN_is_global_reg, and TN_number.

Referenced by Distribute_TN_BB_LIST_MAPs().

static void BB_Live_Use_Union1 ( BB bb,
TN tn 
) [static]

Definition at line 408 of file gra_live.cxx.

References BB_live_use, FmtAssert, TN_is_global_reg, and TN_number.

Referenced by Distribute_TN_BB_LIST_MAPs().

static void BB_REGION_Forward_Depth_First_Visit ( const BB_REGION region,
BB_VISITED_COUNTER counter,
void(*)(BB *bb pre_visit_func,
void(*)(BB *bb post_visit_func 
) [static]

static void BB_REGION_Forward_Depth_First_Visit_BB ( BB bb,
BB_VISITED_COUNTER counter,
void(*)(BB *bb pre_visit_func,
void(*)(BB *bb post_visit_func 
) [static]

void BB_REGION_Recompute_Global_Live_Info ( const BB_REGION region,
BOOL  recompute_local_info 
)

static void Check_TN_BB_LIST_MAPs_Allocated ( void   )  [static]

Definition at line 355 of file gra_live.cxx.

References MEM_POOL_Push, TN_BB_LIST_MAP_Create(), and TRUE.

Referenced by GRA_LIVE_Init_BB_End().

static void Clear_Defreach ( BB bb  )  [static]

static void Compute_Force_TNs ( void   )  [static]

static void Deallocate_TN_BB_LIST_MAPs ( void   )  [static]

Definition at line 376 of file gra_live.cxx.

References FALSE, MEM_POOL_Pop, and NULL.

Referenced by Distribute_TN_BB_LIST_MAPs().

static void Defreach_Propagate ( BB bb  )  [static]

static void Detect_GTNs ( void   )  [static]

static void Detect_Multiply_Defined_GTNs ( GTN_SET *  multiple_defined_set,
MEM_POOL pool 
) [static]

static void Distribute_TN_BB_LIST_MAPs ( void   )  [static]

static void Do_Nothing ( BB bb  )  [static]

void Force_Live_Add ( TN tn  ) 

Definition at line 555 of file gra_live.cxx.

References force_live_gtns, and GTN_UNIVERSE_Add_TN().

Referenced by Compute_Force_TNs().

void Force_Live_Remove ( TN tn  ) 

Definition at line 570 of file gra_live.cxx.

References force_live_gtns.

Referenced by Rename_TNs_For_BB().

static PQS_TN_SET* get_usedef_set ( TN_MAP  map,
TN tn 
) [static]

Definition at line 2111 of file gra_live.cxx.

References CXX_NEW, PQS_mem_pool, TN_MAP_Get(), and TN_MAP_Set().

Referenced by GRA_LIVE_Compute_Local_Info().

void GRA_LIVE_Add_Defreach_In_GTN ( BB bb,
TN tn 
)

void GRA_LIVE_Add_Defreach_Out_GTN ( BB bb,
TN tn 
)

void GRA_LIVE_Add_Live_Def_GTN ( BB bb,
TN tn 
)

Definition at line 1903 of file gra_live.cxx.

References BB_live_def, Is_True, and TN_is_global_reg.

Referenced by mark_tn_live_into_BB(), and Update_GRA_Live_Sets().

void GRA_LIVE_Add_Live_In_GTN ( BB bb,
TN tn 
)

void GRA_LIVE_Add_Live_Out_GTN ( BB bb,
TN tn 
)

void GRA_LIVE_Add_Live_Use_GTN ( BB bb,
TN tn 
)

void GRA_LIVE_Compute_Liveness_For_BB ( BB bb  ) 

void GRA_LIVE_Compute_Local_Info ( BB bb  ) 

void GRA_LIVE_Detect_GTNs_In_Set ( BB_SET *  bbs  ) 

void GRA_LIVE_dump_liveness ( void   ) 

Definition at line 672 of file gra_live.cxx.

References GRA_LIVE_fdump_liveness().

void GRA_LIVE_fdump_liveness ( FILE f  ) 

static void GRA_LIVE_Finalize_Memory ( void   )  [static]

void GRA_LIVE_Fini_Loop (  ) 

Definition at line 2099 of file gra_live.cxx.

References NULL.

Referenced by CG_LOOP::Recompute_Liveness().

void GRA_LIVE_Finish_PU ( void   ) 

Definition at line 2043 of file gra_live.cxx.

References FALSE, force_live_gtns, GRA_LIVE_Finalize_Memory(), GRA_LIVE_Phase_Invoked, and NULL.

Referenced by CG_Generate_Code().

void GRA_LIVE_Finish_REGION ( void   ) 

Definition at line 2059 of file gra_live.cxx.

References FALSE, force_live_gtns, GRA_LIVE_Phase_Invoked, and NULL.

Referenced by CG_Generate_Code(), and GRA_LIVE_Recalc_Liveness().

void GRA_LIVE_Init ( RID rid  ) 

static void GRA_LIVE_Init_BB_End ( BB bb  )  [static]

static void GRA_LIVE_Init_BB_Start ( BB bb  )  [static]

Definition at line 724 of file gra_live.cxx.

References Last_TN, MEM_POOL_Push, tmp_live_def, and tmp_live_use.

Referenced by GRA_LIVE_Compute_Local_Info().

void GRA_LIVE_Init_Loop ( BB pbb,
BB bbb,
BB ebb,
CG_LOOP_BACKPATCH pbp,
CG_LOOP_BACKPATCH ebp 
)

Definition at line 2081 of file gra_live.cxx.

Referenced by GRA_LIVE_Init(), and CG_LOOP::Recompute_Liveness().

static void GRA_LIVE_Initialize_Memory ( void   )  [static]

void GRA_LIVE_Local_Live_Propagate ( BB bb  ) 

void GRA_LIVE_Local_Live_Propagate2 ( BB pred,
BB succ 
)

static void GRA_LIVE_Localize_TNs ( void   )  [static]

void GRA_LIVE_Merge_Blocks ( BB dst,
BB a,
BB b 
)

Definition at line 1927 of file gra_live.cxx.

Referenced by Append_Succ(), Join_Entry(), and Join_Exit().

void GRA_LIVE_Print_Liveness ( BB bb  ) 

Definition at line 631 of file gra_live.cxx.

Referenced by GRA_LIVE_fdump_liveness(), and Print_BB_Header().

void GRA_LIVE_Recalc_Liveness ( RID rid  ) 

void GRA_LIVE_Region_Compute_Global_Live_Info ( void   ) 

void GRA_LIVE_Region_Entry ( BB bb  ) 

void GRA_LIVE_Region_Exit ( BB bb  ) 

void GRA_LIVE_Region_Start ( void   ) 

void GRA_LIVE_Remove_Defreach_In_GTN ( BB bb,
TN tn 
)

Definition at line 1864 of file gra_live.cxx.

References BB_defreach_in, Is_True, and TN_is_global_reg.

Referenced by Clear_Defreach(), and Rename_TNs_For_BB().

void GRA_LIVE_Remove_Defreach_Out_GTN ( BB bb,
TN tn 
)

Definition at line 1880 of file gra_live.cxx.

References BB_defreach_out, Is_True, and TN_is_global_reg.

Referenced by Clear_Defreach(), Rename_TNs_For_BB(), and Update_GRA_Live_Sets().

void GRA_LIVE_Remove_Live_Def_GTN ( BB bb,
TN tn 
)

Definition at line 1911 of file gra_live.cxx.

References BB_live_def, Is_True, and TN_is_global_reg.

Referenced by Rename_TNs_For_BB(), and Update_GRA_Live_Sets().

void GRA_LIVE_Remove_Live_In_GTN ( BB bb,
TN tn 
)

void GRA_LIVE_Remove_Live_Out_GTN ( BB bb,
TN tn 
)

void GRA_LIVE_Remove_Live_Use_GTN ( BB bb,
TN tn 
)

Definition at line 1896 of file gra_live.cxx.

References BB_live_use, Is_True, and TN_is_global_reg.

Referenced by Update_GRA_Live_Sets().

void GRA_LIVE_Rename_TNs ( void   ) 

static void GRA_LIVE_Set_Entries_Exits ( RID rid  )  [static]

BOOL GRA_LIVE_TN_Live_Into_BB ( TN tn,
BB bb 
)

BOOL GRA_LIVE_TN_Live_Outof_BB ( TN tn,
BB bb 
)

static void Live_Init ( BB bb  )  [static]

static void Live_Propagate ( BB bb  )  [static]

static void Localize_TNs_For_BB ( BB bb  )  [static]

static void Region_Boundary_Fixup ( void   )  [static]

static void Rename_TN_In_Range ( TN tn,
OP op1,
OP op2 
) [static]

void Rename_TNs_For_BB ( BB bb,
GTN_SET *  multiple_defined_set 
)

static void TN_BB_LIST_MAP_Add ( TN_BB_LIST_MAP map,
TN tn,
BB bb 
) [static]

static TN_BB_LIST_MAP* TN_BB_LIST_MAP_Create ( void   )  [static]

Definition at line 218 of file gra_live.cxx.

References TYPE_MEM_POOL_ALLOC.

Referenced by Check_TN_BB_LIST_MAPs_Allocated().

static void TN_BB_LIST_MAP_Process_Pairs ( TN_BB_LIST_MAP map,
void(*)(BB *, TN *)  union1_fn 
) [static]

static BB_LIST* TN_BB_LIST_MAP_TN_To_BB_LIST ( TN_BB_LIST_MAP map,
TN tn 
) [static]

Definition at line 233 of file gra_live.cxx.

References NULL, TN_BB_LIST_MAP_tn_bbs, TN_BB_LIST_MAP_tn_bbs_size, and TN_number.

Referenced by TN_BB_LIST_MAP_Process_Pairs().

static void Union1D_BB_Defreach_In ( TN tn,
BB bb 
) [static]

Definition at line 451 of file gra_live.cxx.

References BB_defreach_in, FmtAssert, TN_is_global_reg, and TN_number.

static void Union1D_BB_Live_Out ( TN tn,
BB bb 
) [static]

Definition at line 466 of file gra_live.cxx.

References BB_live_out, FmtAssert, TN_is_global_reg, and TN_number.

static void Update_Local_Liveness_Info ( void   )  [static]


Variable Documentation

Definition at line 132 of file gra_live.cxx.

Referenced by GRA_LIVE_Region_Compute_Global_Live_Info().

BB* body_bb [static]

BOOL change [static]

TN* defreach_tn [static]

Definition at line 2423 of file gra_live.cxx.

BB* epilog_bb [static]

Definition at line 2077 of file gra_live.cxx.

Definition at line 2079 of file gra_live.cxx.

GTN_SET* force_live_gtns

Definition at line 106 of file gra_live.cxx.

Definition at line 105 of file gra_live.cxx.

BOOL gra_live_pools_initialized = FALSE [static]

Definition at line 108 of file gra_live.cxx.

Referenced by GRA_LIVE_Finalize_Memory(), and GRA_LIVE_Initialize_Memory().

Definition at line 125 of file gra_live.cxx.

Definition at line 110 of file gra_live.cxx.

BOOL liveness_pool_initialized = FALSE [static]

Definition at line 111 of file gra_live.cxx.

Referenced by GRA_LIVE_Finalize_Memory(), and GRA_LIVE_Initialize_Memory().

BB_LIST* new_bbs [static]

BB* prolog_bb [static]

Definition at line 2075 of file gra_live.cxx.

Definition at line 2078 of file gra_live.cxx.

Definition at line 103 of file gra_live.cxx.

BB_SET* region_exit_set [static]

TN_SET* tmp_live_def [static]

TN_SET* tmp_live_use [static]

Definition at line 107 of file gra_live.cxx.

Definition at line 336 of file gra_live.cxx.

Definition at line 342 of file gra_live.cxx.

Definition at line 341 of file gra_live.cxx.

UINT32 visited_mark [static]


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