osprey/be/region/ori.cxx File Reference

#include <list>
#include "defs.h"
#include "tracing.h"
#include "errors.h"
#include "erglob.h"
#include "mempool.h"
#include "wn.h"
#include "wn_util.h"
#include "opcode.h"
#include "ir_reader.h"
#include "config.h"
#include "xstats.h"
#include "targ_sim.h"
#include "timing.h"
#include "ori.h"
#include "opt_goto.h"
#include "region_util.h"

Include dependency graph for ori.cxx:

Go to the source code of this file.

Data Types

type  wnlist
type  ori_block
type  oblist

Defines

#define WNLIST_item(s)   ((s)->item)
#define WNLIST_next(s)   ((s)->next)
#define OB_id(b)   ((b) ? (b)->id : 0)
#define Set_OB_id(b, v)   ((b)->id = v)
#define OB_tree(b)   ((b)->tree)
#define OB_end_tree(b)   ((b)->end_tree)
#define OB_container(b)   ((b)->container)
#define OB_num_stmts(b)   ((b)->num_stmts)
#define OB_num_bbs(b)   ((b)->num_bbs)
#define OB_labels(b)   ((b)->labels)
#define OB_parent(b)   ((b)->parent)
#define OB_child(b)   ((b)->child)
#define OB_sibling(b)   ((b)->sibling)
#define OB_expanded(b)   ((b)->expanded)
#define OB_no_more_merge(b)   ((b)->no_more_merge)
#define OB_nested_region(b)   ((b)->nested_region)
#define OB_never_in_region(b)   ((b)->never_in_region)
#define OB_illegal(b)   ((b)->illegal)
#define OB_size(b)   COMPUTE_OLIMIT(OB_num_bbs(b),OB_num_stmts(b))
#define OB_sub_size(a, b)   COMPUTE_OLIMIT((OB_num_bbs(a) - OB_num_bbs(b)),(OB_num_stmts(a) - OB_num_stmts(b)))
#define OB_first_sibling(b)   (OB_child(OB_parent(b)))
#define OBLIST_item(s)   ((s)->item)
#define OBLIST_next(s)   ((s)->next)
#define IS_RETURN_PREG(wn)
#define MIN_BLOCK_SIZE(olimit)   (olimit / 4)

Typedefs

typedef struct wnlist WNLIST
typedef struct ori_block ORI_BLOCK
typedef struct oblist OBLIST

Enumerations

enum  BLOCK_SIZE { TOO_SMALL, JUST_RIGHT, TOO_BIG }

Functions/Subroutines

static void Initialize_Trace_Flags (void)
static void Initialize_ORI (void)
static void Check_Dump (WN *tree, const char *msg)
static void Add_Wn_To_List (WN *wn, WNLIST **wnlist)
static void Remove_Wn_From_List (WN *wn, WNLIST **wnlist)
static void Add_Ob_To_List (ORI_BLOCK *ob, OBLIST **oblist)
static void Remove_Ob_From_List (ORI_BLOCK *ob, OBLIST **oblist)
static ORI_BLOCKOB_prev (ORI_BLOCK *b)
static INT OB_level (ORI_BLOCK *b)
static void Print_Ori_Block (FILE *f, ORI_BLOCK *b)
static void Get_First_Stmt_And_Container (ORI_BLOCK *b, WN **stmt, WN **container)
static ORI_BLOCKNew_Ori_Block (WN *tree, ORI_BLOCK *parent)
static void Propagate_Size_Info (ORI_BLOCK *b, INT32 num_bbs, INT32 num_stmts)
static void Propagate_Child_Info (ORI_BLOCK *b)
static BOOL Uses_Return_Preg (WN *tree)
static BOOL Is_Call_With_Alternate_Return (WN *call, WN *stmt)
static ORI_BLOCKBuild_Ori_Blocks (WN *tree, INT32 olimit)
static void Insert_Region_Around_Block (ORI_BLOCK *b)
static void Move_Branches_To_Child (ORI_BLOCK *parent, ORI_BLOCK *child)
static ORI_BLOCKCreate_New_Child (ORI_BLOCK *parent, ORI_BLOCK *prev, ORI_BLOCK *sibling, WN *tree, WN *end_tree, INT num_bbs, INT num_stmts)
static void Split_Block (ORI_BLOCK *b)
static void Expand_Sibling_Blocks (ORI_BLOCK *first)
static ORI_BLOCKCreate_Merged_Block (ORI_BLOCK *start, ORI_BLOCK *last, ORI_BLOCK *before_start, ORI_BLOCK *after_last)
static void Update_Label_Info (ORI_BLOCK *b)
static BOOL Merge_Across_Labels (ORI_BLOCK **first, INT32 olimit)
static void Merge_Blocks (ORI_BLOCK *first, INT32 olimit)
static BOOL Build_Blocks_In_Region_List (ORI_BLOCK *b, WNLIST *entry_label)
static BOOL Branch_In_Region_List (UINT32 branch_id)
static BOOL Region_Is_Illegal (ORI_BLOCK *b)
static BLOCK_SIZE Olimit_Size (ORI_BLOCK *b, INT32 olimit)
static ORI_BLOCKFind_Largest_Block (ORI_BLOCK *first)
static BOOL Insert_Smaller_Regions (ORI_BLOCK *parent, INT32 olimit)
static ORI_BLOCKChoose_Region_Block (ORI_BLOCK *b, INT32 olimit, BLOCK_SIZE *bs)
WNOlimit_Region_Insertion (WN *pu_tree, INT32 olimit)

Variables

static BOOL Trace_ORI = FALSE
static BOOL Run_Goto_Conversion = FALSE
static BOOL Trace_Goto_Conversion = FALSE
static BOOL Trace_Merging = FALSE
static BOOL Trace_Blocks = FALSE
static MEM_POOL Ori_pool
static ORI_BLOCKpu_block
static ORI_BLOCKcur_block
static INT last_id = 0
static INT num_regions = 0
static UINT32blocks_in_region
static INT last_block_in_region_index = 0
static INT max_block_in_region_index = 0
static WNLIST ** labels_in_region
static INT last_label_in_region_index = 0
static OBLIST ** label_branches


Define Documentation

#define IS_RETURN_PREG ( wn   ) 

#define MIN_BLOCK_SIZE ( olimit   )     (olimit / 4)

Definition at line 1458 of file ori.cxx.

Referenced by Olimit_Size().

#define OB_child ( b   )     ((b)->child)

#define OB_container ( b   )     ((b)->container)

#define OB_end_tree ( b   )     ((b)->end_tree)

#define OB_expanded ( b   )     ((b)->expanded)

#define OB_first_sibling ( b   )     (OB_child(OB_parent(b)))

Definition at line 136 of file ori.cxx.

Referenced by Choose_Region_Block(), and OB_prev().

#define OB_id ( b   )     ((b) ? (b)->id : 0)

#define OB_illegal ( b   )     ((b)->illegal)

#define OB_labels ( b   )     ((b)->labels)

#define OB_nested_region ( b   )     ((b)->nested_region)

#define OB_never_in_region ( b   )     ((b)->never_in_region)

#define OB_no_more_merge ( b   )     ((b)->no_more_merge)

Definition at line 124 of file ori.cxx.

Referenced by Choose_Region_Block(), Merge_Blocks(), New_Ori_Block(), and Print_Ori_Block().

#define OB_num_bbs ( b   )     ((b)->num_bbs)

#define OB_num_stmts ( b   )     ((b)->num_stmts)

#define OB_parent ( b   )     ((b)->parent)

#define OB_sibling ( b   )     ((b)->sibling)

#define OB_size ( b   )     COMPUTE_OLIMIT(OB_num_bbs(b),OB_num_stmts(b))

#define OB_sub_size ( a,
b   )     COMPUTE_OLIMIT((OB_num_bbs(a) - OB_num_bbs(b)),(OB_num_stmts(a) - OB_num_stmts(b)))

Definition at line 134 of file ori.cxx.

Referenced by Olimit_Size().

#define OB_tree ( b   )     ((b)->tree)

#define OBLIST_item (  )     ((s)->item)

#define OBLIST_next (  )     ((s)->next)

#define Set_OB_id ( b,
 )     ((b)->id = v)

Definition at line 113 of file ori.cxx.

Referenced by New_Ori_Block().

#define WNLIST_item (  )     ((s)->item)

#define WNLIST_next (  )     ((s)->next)


Typedef Documentation

typedef struct oblist OBLIST

typedef struct wnlist WNLIST


Enumeration Type Documentation

enum BLOCK_SIZE

Enumerator:
TOO_SMALL 
JUST_RIGHT 
TOO_BIG 

Definition at line 1456 of file ori.cxx.


Function Documentation

static void Add_Ob_To_List ( ORI_BLOCK ob,
OBLIST **  oblist 
) [static]

Definition at line 244 of file ori.cxx.

References MEM_POOL_Alloc, NULL, OBLIST_item, OBLIST_next, and p.

Referenced by Build_Ori_Blocks(), Move_Branches_To_Child(), and Update_Label_Info().

static void Add_Wn_To_List ( WN wn,
WNLIST **  wnlist 
) [static]

Definition at line 210 of file ori.cxx.

References MEM_POOL_Alloc, p, WNLIST_item, and WNLIST_next.

Referenced by Build_Ori_Blocks().

static BOOL Branch_In_Region_List ( UINT32  branch_id  )  [static]

Definition at line 1395 of file ori.cxx.

References blocks_in_region, FALSE, i, INT, last_block_in_region_index, and TRUE.

Referenced by Region_Is_Illegal().

static BOOL Build_Blocks_In_Region_List ( ORI_BLOCK b,
WNLIST entry_label 
) [static]

static ORI_BLOCK* Build_Ori_Blocks ( WN tree,
INT32  olimit 
) [static]

static void Check_Dump ( WN tree,
const char *  msg 
) [static]

Definition at line 198 of file ori.cxx.

References DBar, fdump_tree(), fprintf(), fputs(), Get_Trace(), TFile, TKIND_IR, and TP_ORI.

Referenced by Olimit_Region_Insertion().

static ORI_BLOCK* Choose_Region_Block ( ORI_BLOCK b,
INT32  olimit,
BLOCK_SIZE bs 
) [static]

static ORI_BLOCK* Create_Merged_Block ( ORI_BLOCK start,
ORI_BLOCK last,
ORI_BLOCK before_start,
ORI_BLOCK after_last 
) [static]

static ORI_BLOCK* Create_New_Child ( ORI_BLOCK parent,
ORI_BLOCK prev,
ORI_BLOCK sibling,
WN tree,
WN end_tree,
INT  num_bbs,
INT  num_stmts 
) [static]

static void Expand_Sibling_Blocks ( ORI_BLOCK first  )  [static]

static ORI_BLOCK* Find_Largest_Block ( ORI_BLOCK first  )  [static]

static void Get_First_Stmt_And_Container ( ORI_BLOCK b,
WN **  stmt,
WN **  container 
) [static]

static void Initialize_ORI ( void   )  [static]

static void Initialize_Trace_Flags ( void   )  [static]

static void Insert_Region_Around_Block ( ORI_BLOCK b  )  [static]

static BOOL Insert_Smaller_Regions ( ORI_BLOCK parent,
INT32  olimit 
) [static]

static BOOL Is_Call_With_Alternate_Return ( WN call,
WN stmt 
) [static]

static BOOL Merge_Across_Labels ( ORI_BLOCK **  first,
INT32  olimit 
) [static]

static void Merge_Blocks ( ORI_BLOCK first,
INT32  olimit 
) [static]

static void Move_Branches_To_Child ( ORI_BLOCK parent,
ORI_BLOCK child 
) [static]

static ORI_BLOCK* New_Ori_Block ( WN tree,
ORI_BLOCK parent 
) [static]

static INT OB_level ( ORI_BLOCK b  )  [static]

Definition at line 296 of file ori.cxx.

References INT, NULL, and OB_parent.

Referenced by Update_Label_Info().

static ORI_BLOCK* OB_prev ( ORI_BLOCK b  )  [static]

Definition at line 284 of file ori.cxx.

References NULL, OB_first_sibling, OB_sibling, and prev.

Referenced by Merge_Across_Labels().

WN* Olimit_Region_Insertion ( WN pu_tree,
INT32  olimit 
)

static BLOCK_SIZE Olimit_Size ( ORI_BLOCK b,
INT32  olimit 
) [static]

static void Print_Ori_Block ( FILE f,
ORI_BLOCK b 
) [static]

static void Propagate_Child_Info ( ORI_BLOCK b  )  [static]

Definition at line 441 of file ori.cxx.

References OB_child, OB_num_bbs, OB_num_stmts, OB_parent, OB_sibling, and Propagate_Size_Info().

Referenced by Olimit_Region_Insertion().

static void Propagate_Size_Info ( ORI_BLOCK b,
INT32  num_bbs,
INT32  num_stmts 
) [static]

Definition at line 425 of file ori.cxx.

References NULL, OB_num_bbs, OB_num_stmts, and OB_parent.

Referenced by Insert_Region_Around_Block(), and Propagate_Child_Info().

static BOOL Region_Is_Illegal ( ORI_BLOCK b  )  [static]

static void Remove_Ob_From_List ( ORI_BLOCK ob,
OBLIST **  oblist 
) [static]

Definition at line 260 of file ori.cxx.

References NULL, OBLIST_item, OBLIST_next, p, and prev.

Referenced by Move_Branches_To_Child(), and Update_Label_Info().

static void Remove_Wn_From_List ( WN wn,
WNLIST **  wnlist 
) [static]

Definition at line 223 of file ori.cxx.

References FmtAssert, NULL, p, prev, WNLIST_item, and WNLIST_next.

Referenced by Update_Label_Info().

static void Split_Block ( ORI_BLOCK b  )  [static]

static void Update_Label_Info ( ORI_BLOCK b  )  [static]

static BOOL Uses_Return_Preg ( WN tree  )  [static]

Definition at line 461 of file ori.cxx.

References FALSE, IS_RETURN_PREG, NULL, OPR_LDID, TRUE, wn, WN_ITER_wn, WN_operator(), WN_WALK_TreeIter(), and WN_WALK_TreeNext().

Referenced by Split_Block().


Variable Documentation

ORI_BLOCK* cur_block [static]

Definition at line 154 of file ori.cxx.

Referenced by reemit_insn_block_notes(), and scope_to_insns_finalize().

OBLIST** label_branches [static]

Definition at line 166 of file ori.cxx.

Definition at line 161 of file ori.cxx.

INT last_id = 0 [static]

Definition at line 162 of file ori.cxx.

Referenced by Build_Blocks_In_Region_List(), and Region_Is_Illegal().

Definition at line 160 of file ori.cxx.

Referenced by Build_Blocks_In_Region_List(), and Region_Is_Illegal().

INT num_regions = 0 [static]

MEM_POOL Ori_pool [static]

Definition at line 152 of file ori.cxx.

ORI_BLOCK* pu_block [static]

Definition at line 153 of file ori.cxx.

BOOL Run_Goto_Conversion = FALSE [static]

Definition at line 146 of file ori.cxx.

Referenced by Initialize_Trace_Flags(), and Olimit_Region_Insertion().

BOOL Trace_Blocks = FALSE [static]

Definition at line 151 of file ori.cxx.

Referenced by Expand_Sibling_Blocks(), Initialize_Trace_Flags(), Merge_Blocks(), and Split_Block().

BOOL Trace_Goto_Conversion = FALSE [static]

Definition at line 149 of file ori.cxx.

Referenced by Initialize_Trace_Flags(), and Olimit_Region_Insertion().

BOOL Trace_Merging = FALSE [static]

BOOL Trace_ORI = FALSE [static]


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