Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
PUinfo.cxx File Reference
#include <string.h>
#include "common_include.h"
#include "w2cf_parentize.h"
#include "mempool.h"
#include "const.h"
#include "wn_util.h"
#include "PUinfo.h"
#include "targ_sim.h"
#include "unparse_target.h"
Include dependency graph for PUinfo.cxx:

Go to the source code of this file.

Classes

struct  Preg_Info

Defines

#define IS_RETURN_PREG(wn)
#define FIRST_PREG_USAGE_KIND   PREG_AS_INT8
#define SMALLEST_iPREG_USAGE_KIND   FIRST_PREG_USAGE_KIND
#define LARGEST_iPREG_USAGE_KIND   PREG_AS_UINT64
#define LAST_PREG_USAGE_KIND   PREG_AS_CQ
#define PREG_INFO_use(info, ukind)   (info)->use[ukind]
#define PREG_INFO_decl(info, ukind)   (info)->decl[ukind]
#define PREG_INFO_preg_num(info)   (info)->preg_num
#define PREG_INFO_next(info)   (info)->next
#define PREG_INFO_HASH_TABLE_SIZE   73
#define PREG_INFO_HASH_IDX(offset)   (UINT32)(offset % PREG_INFO_HASH_TABLE_SIZE)
#define PUINFO_WN_ITER_wn(iter)   (iter != NULL? WN_ITER_wn(iter) : NULL)
#define PUINFO_WN_WALK_TreeNext(iter)   (iter != NULL? WN_WALK_TreeNext(iter) : NULL)
#define PUINFO_WN_WALK_StmtNext(iter)   (iter != NULL? WN_WALK_StmtNext(iter) : NULL)

Typedefs

typedef enum Preg_Usage_Kind PREG_USAGE_KIND
typedef struct Preg_Info PREG_INFO

Enumerations

enum  Preg_Usage_Kind {
  PREG_AS_UNKNOWN, PREG_AS_INT8, PREG_AS_UINT8, PREG_AS_INT16,
  PREG_AS_UINT16, PREG_AS_INT32, PREG_AS_UINT32, PREG_AS_INT64,
  PREG_AS_UINT64, PREG_AS_IEEE32, PREG_AS_IEEE64, PREG_AS_QUAD,
  PREG_AS_C4, PREG_AS_C8, PREG_AS_CQ
}

Functions

static BOOL WN_in_ioitem (const WN *wn)
static PREG_USAGE_KIND Mtype_to_Ukind (MTYPE mtype)
static PREG_INFOGet_Preg_Info (INT16 preg_num)
static void Accumulate_Preg_Info (TY_IDX preg_ty, INT16 preg_num)
static void Enter_Pregs_Into_Symtab (void)
static void Enter_Local_Syms_Into_Symtab (const ST *func_st)
static void Var_Loaded_From (const WN *wn, const ST **st, STAB_OFFSET *offset)
static void Var_Stored_In (const WN *wn, const ST **st, STAB_OFFSET *offset)
static const WNDoes_Stmt_Store_From_Preg (const WN *wn, STAB_OFFSET preg_num)
static const WNDoes_Stmt_Store_Into_Preg (const WN *wn, STAB_OFFSET preg_num)
static CALLSITENew_CallSite (const WN *call_wn, TY_IDX return_ty, const WN *store1_wn, const WN *store2_wn, const ST *return_var, STAB_OFFSET var_offset)
static RETURNSITENew_ReturnSite (const WN *return_wn, const WN *store1_wn, const WN *store2_wn, const ST *return_var, STAB_OFFSET var_offset)
static WN_ITERAppend_CallSite (WN_ITER *stmt_iter, const WN *next_stmt)
static WN_ITERAppend_ReturnSite (WN_ITER *stmt_iter, const WN *first_stmt)
static void Accumulate_Stmt_PUinfo (WN *wn)
static void Accumulate_Expr_PUinfo (WN *root)
void PUinfo_initialize (void)
void PUinfo_finalize (void)
void PUinfo_init_pu (const WN *pu, WN *body_part_of_interest)
void PUinfo_exit_pu (void)
TY_IDX PUinfo_Preg_Type (TY_IDX preg_ty, INT16 preg_num)
BOOL PUinfo_Is_Preg_Declared (TY_IDX preg_ty, INT16 preg_num)
void PUinfo_Set_Preg_Declared (TY_IDX preg_ty, INT16 preg_num)
CALLSITEPUinfo_Get_CallSites (void)
RETURNSITEPUinfo_Get_ReturnSites (void)
RETURN_PREG PUinfo_Get_ReturnPreg (TY_IDX return_ty)

Variables

const WNPUinfo_current_func = NULL
const RETURN_PREGPUinfo_return_preg = NULL
TOKEN_BUFFER PUinfo_local_decls = NULL
TOKEN_BUFFER PUinfo_pragmas = NULL
UINT PUinfo_local_decls_indent = 0
static const MTYPE Ukind_to_Mtype [LAST_PREG_USAGE_KIND+1]
static PREG_INFOPreg_Info_Hash_Tbl [PREG_INFO_HASH_TABLE_SIZE]
static PREG_INFOFree_Preg_Info = NULL
static CALLSITECallSite_First = NULL
static CALLSITECallSite_Last = NULL
static CALLSITECallSite_Free = NULL
static RETURNSITEReturnSite_First = NULL
static RETURNSITEReturnSite_Last = NULL
static RETURNSITEReturnSite_Free = NULL

Define Documentation

Definition at line 133 of file PUinfo.cxx.

Referenced by Accumulate_Preg_Info().

#define IS_RETURN_PREG (   wn)
Value:

Definition at line 78 of file PUinfo.cxx.

Referenced by Accumulate_Expr_PUinfo().

Definition at line 135 of file PUinfo.cxx.

Referenced by Enter_Pregs_Into_Symtab(), and PUinfo_Preg_Type().

Definition at line 136 of file PUinfo.cxx.

Referenced by Accumulate_Preg_Info(), and Enter_Pregs_Into_Symtab().

#define PREG_INFO_decl (   info,
  ukind 
)    (info)->decl[ukind]
#define PREG_INFO_HASH_IDX (   offset)    (UINT32)(offset % PREG_INFO_HASH_TABLE_SIZE)

Definition at line 171 of file PUinfo.cxx.

Referenced by Accumulate_Preg_Info(), and Get_Preg_Info().

#define PREG_INFO_HASH_TABLE_SIZE   73

Definition at line 170 of file PUinfo.cxx.

Referenced by Enter_Pregs_Into_Symtab(), and PUinfo_exit_pu().

#define PREG_INFO_next (   info)    (info)->next
#define PREG_INFO_preg_num (   info)    (info)->preg_num

Definition at line 167 of file PUinfo.cxx.

Referenced by Accumulate_Preg_Info(), Enter_Pregs_Into_Symtab(), and Get_Preg_Info().

#define PREG_INFO_use (   info,
  ukind 
)    (info)->use[ukind]

Definition at line 165 of file PUinfo.cxx.

Referenced by Accumulate_Preg_Info(), Enter_Pregs_Into_Symtab(), and PUinfo_Preg_Type().

#define PUINFO_WN_ITER_wn (   iter)    (iter != NULL? WN_ITER_wn(iter) : NULL)
#define PUINFO_WN_WALK_StmtNext (   iter)    (iter != NULL? WN_WALK_StmtNext(iter) : NULL)

Definition at line 495 of file PUinfo.cxx.

Referenced by Accumulate_Stmt_PUinfo(), Append_CallSite(), and Append_ReturnSite().

#define PUINFO_WN_WALK_TreeNext (   iter)    (iter != NULL? WN_WALK_TreeNext(iter) : NULL)

Definition at line 493 of file PUinfo.cxx.

Referenced by Accumulate_Expr_PUinfo().

Definition at line 134 of file PUinfo.cxx.

Referenced by Enter_Pregs_Into_Symtab().


Typedef Documentation

typedef struct Preg_Info PREG_INFO

Definition at line 157 of file PUinfo.cxx.


Enumeration Type Documentation

Enumerator:
PREG_AS_UNKNOWN 
PREG_AS_INT8 
PREG_AS_UINT8 
PREG_AS_INT16 
PREG_AS_UINT16 
PREG_AS_INT32 
PREG_AS_UINT32 
PREG_AS_INT64 
PREG_AS_UINT64 
PREG_AS_IEEE32 
PREG_AS_IEEE64 
PREG_AS_QUAD 
PREG_AS_C4 
PREG_AS_C8 
PREG_AS_CQ 

Definition at line 114 of file PUinfo.cxx.


Function Documentation

static WN_ITER* Append_ReturnSite ( WN_ITER stmt_iter,
const WN first_stmt 
) [static]
static const WN* Does_Stmt_Store_From_Preg ( const WN wn,
STAB_OFFSET  preg_num 
) [static]

Definition at line 558 of file PUinfo.cxx.

References CLASS_PREG, NULL, OPR_ISTORE, OPR_LDID, OPR_STID, ST_sym_class(), wn, WN_kid0(), WN_load_offset(), WN_opc_operator, and WN_st().

Referenced by Append_CallSite().

Here is the call graph for this function:

static const WN* Does_Stmt_Store_Into_Preg ( const WN wn,
STAB_OFFSET  preg_num 
) [static]

Definition at line 572 of file PUinfo.cxx.

References CLASS_PREG, NULL, OPR_STID, ST_sym_class(), wn, WN_opc_operator, WN_st(), and WN_store_offset().

Referenced by Append_ReturnSite().

Here is the call graph for this function:

static CALLSITE* New_CallSite ( const WN call_wn,
TY_IDX  return_ty,
const WN store1_wn,
const WN store2_wn,
const ST return_var,
STAB_OFFSET  var_offset 
) [static]
static RETURNSITE* New_ReturnSite ( const WN return_wn,
const WN store1_wn,
const WN store2_wn,
const ST return_var,
STAB_OFFSET  var_offset 
) [static]
void PUinfo_exit_pu ( void  )

Definition at line 1197 of file PUinfo.cxx.

References CallSite_Free, CALLSITE_next, Free_Preg_Info, NULL, PREG_INFO_HASH_TABLE_SIZE, PREG_INFO_next, Reclaim_Token_Buffer(), ReturnSite_Free, RETURNSITE_next, and W2CF_Symtab_Pop().

Referenced by W2C_Pop_PU(), and W2F_Pop_PU().

Here is the call graph for this function:

void PUinfo_finalize ( void  )

Definition at line 1118 of file PUinfo.cxx.

References CallSite_Free, CALLSITE_next, FREE, NULL, and ReturnSite_Free.

Referenced by W2C_Fini(), and W2F_Fini().

Definition at line 1328 of file PUinfo.cxx.

References CallSite_First.

Referenced by Accumulate_Expr_PUinfo(), WN2C_call(), WN2F_call(), and WN2F_intrinsic_call().

Definition at line 1335 of file PUinfo.cxx.

References ReturnSite_First.

Referenced by WN2C_func_entry(), and WN2F_Enter_PU_Block().

void PUinfo_initialize ( void  )

Definition at line 1107 of file PUinfo.cxx.

References Is_True, and NULL.

Referenced by W2C_Init(), and W2F_Init().

BOOL PUinfo_Is_Preg_Declared ( TY_IDX  preg_ty,
INT16  preg_num 
)

Definition at line 1295 of file PUinfo.cxx.

References Accumulate_Preg_Info(), Get_Preg_Info(), Mtype_to_Ukind(), NULL, PREG_INFO_decl, TRUE, and TY_mtype().

Referenced by ST2C_Use_Preg(), and ST2F_Use_Preg().

Here is the call graph for this function:

void PUinfo_Set_Preg_Declared ( TY_IDX  preg_ty,
INT16  preg_num 
)

Definition at line 1313 of file PUinfo.cxx.

References Accumulate_Preg_Info(), Get_Preg_Info(), Mtype_to_Ukind(), NULL, PREG_INFO_decl, TRUE, and TY_mtype().

Referenced by ST2C_Use_Preg(), and ST2F_Use_Preg().

Here is the call graph for this function:

static void Var_Loaded_From ( const WN wn,
const ST **  st,
STAB_OFFSET offset 
) [static]

Definition at line 508 of file PUinfo.cxx.

References Is_True, NULL, OPR_ILOAD, OPR_LDA, OPR_LDID, WN_kid0(), WN_lda_offset(), WN_load_offset(), WN_opc_operator, and WN_st().

Referenced by Append_ReturnSite().

Here is the call graph for this function:

static void Var_Stored_In ( const WN wn,
const ST **  st,
STAB_OFFSET offset 
) [static]

Definition at line 533 of file PUinfo.cxx.

References Is_True, NULL, OPR_ISTORE, OPR_LDA, OPR_STID, WN_kid1(), WN_lda_offset(), WN_opc_operator, WN_st(), and WN_store_offset().

Referenced by Append_CallSite().

Here is the call graph for this function:

static BOOL WN_in_ioitem ( const WN wn) [static]

Definition at line 179 of file PUinfo.cxx.

References FALSE, NULL, OPR_IO_ITEM, OPR_REGION, TRUE, W2CF_Get_Parent(), and WN_opc_operator.

Referenced by Accumulate_Expr_PUinfo(), and Accumulate_Stmt_PUinfo().

Here is the call graph for this function:


Variable Documentation

Definition at line 498 of file PUinfo.cxx.

Referenced by PUinfo_Get_CallSites().

Definition at line 500 of file PUinfo.cxx.

Referenced by New_CallSite(), PUinfo_exit_pu(), and PUinfo_finalize().

Definition at line 499 of file PUinfo.cxx.

Definition at line 175 of file PUinfo.cxx.

Referenced by Accumulate_Preg_Info(), and PUinfo_exit_pu().

Definition at line 174 of file PUinfo.cxx.

Definition at line 502 of file PUinfo.cxx.

Referenced by PUinfo_Get_ReturnSites().

Definition at line 504 of file PUinfo.cxx.

Referenced by New_ReturnSite(), PUinfo_exit_pu(), and PUinfo_finalize().

Definition at line 503 of file PUinfo.cxx.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines