Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include "mem_ctr.h"
#include "wn.h"
#include "stab.h"
#include "strtab.h"
#include "mtypes.h"
#include "targ_const.h"
#include "wn_util.h"
#include "config_targ.h"
#include "const.h"
#include "cxx_template.h"
#include "cxx_hash.h"
Go to the source code of this file.
Defines | |
#define | Set_Parent(wn, p) (WN_MAP_Set(Parent_Map, wn, (void*) p)) |
#define | Get_Parent(wn) ((WN*) WN_MAP_Get(Parent_Map, (WN*) wn)) |
Typedefs | |
typedef STACK< WN * > | STACK_OF_WN |
typedef HASH_TABLE< ST *, BOOL > | STBOOL_HASH_TABLE |
Functions | |
void | MemCtr_Add (WN *pu) |
static ST * | Declare_Function (char *ty_name, char *st_name, INT nparms, TY *ty_array[]) |
static void | Set_Call_Side_Effects (WN *call_wn) |
static void | MemCtr_Init () |
static BOOL | MemCtr_Criteria_Check (ST *st) |
static void | Parentize (WN *wn) |
static void | MemCtr_Add_Global (WN *pu, ST *st, STACK_OF_WN *altentry_stack) |
static void | MemCtr_Add_Common (WN *pu, ST *st, STACK_OF_WN *altentry_stack) |
static void | MemCtr_Add_Local (WN *pu, ST *st, STACK_OF_WN *altentry_stack, STACK_OF_WN *exit_stack) |
static void | Collect_Goodies (WN *pu, STACK_OF_WN *exit_stack, STACK_OF_WN *altentry_stack, STBOOL_HASH_TABLE *used_st_hash) |
static ST * | Find_Address_Base (WN *wn) |
static ST * | Declare_Function (char *ty_name, char *st_name, INT nparms, TY_IDX ty_array[]) |
static BOOL | Is_VLA (ST *st) |
static void | Insert_Call (WN *call_wn, WN *pu, STACK_OF_WN *altentry_stack) |
Variables | |
static INT | memctr_size = 8192 |
static ST * | reg_st_global |
static ST * | reg_st_local |
static ST * | unreg_st_local |
static ST * | reg_st_common |
static MEM_POOL | memctr_pool |
static WN_MAP | Parent_Map = WN_MAP_UNDEFINED |
#define Get_Parent | ( | wn | ) | ((WN*) WN_MAP_Get(Parent_Map, (WN*) wn)) |
Definition at line 79 of file mem_ctr.cxx.
Referenced by Insert_Call(), and MemCtr_Add_Local().
#define Set_Parent | ( | wn, | |
p | |||
) | (WN_MAP_Set(Parent_Map, wn, (void*) p)) |
Definition at line 78 of file mem_ctr.cxx.
Referenced by Insert_Call(), MemCtr_Add_Local(), and Parentize().
typedef STACK<WN *> STACK_OF_WN |
Definition at line 82 of file mem_ctr.cxx.
typedef HASH_TABLE<ST*, BOOL> STBOOL_HASH_TABLE |
Definition at line 83 of file mem_ctr.cxx.
static void Collect_Goodies | ( | WN * | pu, |
STACK_OF_WN * | exit_stack, | ||
STACK_OF_WN * | altentry_stack, | ||
STBOOL_HASH_TABLE * | used_st_hash | ||
) | [static] |
Definition at line 219 of file mem_ctr.cxx.
References KIND_ARRAY, KIND_POINTER, OPCODE_operator(), OPR_ALTENTRY, OPR_ARRAY, OPR_BLOCK, OPR_ILOAD, OPR_INTRINSIC_CALL, OPR_ISTORE, OPR_LDA, OPR_LDID, OPR_RETURN, SCLASS_AUTO, ST_base(), ST_sclass(), St_Table, ST_type(), TRUE, TY_kind(), TY_pointed(), WN_first(), WN_intrinsic(), WN_kid(), WN_kid0(), WN_kid1(), WN_kid_count(), WN_next(), WN_opcode(), WN_operator(), and WN_st_idx().
Referenced by MemCtr_Add().
static ST* Declare_Function | ( | char * | ty_name, |
char * | st_name, | ||
INT | nparms, | ||
TY * | ty_array[] | ||
) | [static] |
Referenced by MemCtr_Init().
static ST* Declare_Function | ( | char * | ty_name, |
char * | st_name, | ||
INT | nparms, | ||
TY_IDX | ty_array[] | ||
) | [static] |
Definition at line 283 of file mem_ctr.cxx.
References Be_Type_Tbl, CLASS_FUNC, EXPORT_PREEMPTIBLE, GLOBAL_SYMTAB, idx, SEGMENTED_ARRAY< T, block_size >::Insert(), KIND_FUNCTION, Make_Pointer_Type(), MTYPE_UNKNOWN, MTYPE_V, New_PU(), New_ST(), New_TY(), Save_Str(), SCLASS_EXTERN, Set_PU_prototype(), Set_TY_align(), Set_TY_tylist(), ST_Init(), TRUE, TY_align(), TY_Init(), TY_size(), and Tylist_Table.
static ST* Find_Address_Base | ( | WN * | wn | ) | [static] |
Definition at line 202 of file mem_ctr.cxx.
References FmtAssert, NULL, OPR_ILOAD, OPR_ISTORE, OPR_LDA, OPR_LDID, St_Table, WN_kid0(), WN_kid1(), WN_operator(), and WN_st_idx().
static void Insert_Call | ( | WN * | call_wn, |
WN * | pu, | ||
STACK_OF_WN * | altentry_stack | ||
) | [static] |
Definition at line 401 of file mem_ctr.cxx.
References FmtAssert, Get_Parent, OPC_PRAGMA, Parentize(), Set_Parent, ST_name(), WN_COPY_Tree(), WN_first(), WN_func_body, WN_INSERT_BlockAfter(), WN_next(), WN_opcode(), WN_pragma(), WN_PRAGMA_PREAMBLE_END, and WN_st().
Referenced by MemCtr_Add_Common(), MemCtr_Add_Global(), and MemCtr_Add_Local().
Definition at line 383 of file mem_ctr.cxx.
References FALSE, KIND_ARRAY, KIND_POINTER, SCLASS_AUTO, ST_base(), ST_sclass(), ST_type(), TRUE, TY_kind(), TY_pointed(), and TY_size().
Referenced by MemCtr_Add_Local().
void MemCtr_Add | ( | WN * | pu | ) |
Definition at line 98 of file mem_ctr.cxx.
References CLASS_VAR, Collect_Goodies(), CURRENT_SYMTAB, CXX_NEW, FALSE, FOREACH_SYMBOL, Get_Current_PU(), GLOBAL_SYMTAB, MEM_POOL_Pop, MEM_POOL_Push, MemCtr_Add_Common(), MemCtr_Add_Global(), MemCtr_Add_Local(), MemCtr_Init(), NULL, Parent_Map, Parentize(), PU_has_altentry(), SCLASS_COMMON, ST_base(), ST_class(), ST_is_reshaped(), ST_sclass(), TRUE, WN_MAP_Create, WN_MAP_Delete, and WN_MAP_UNDEFINED.
Referenced by Backend_Processing().
static void MemCtr_Add_Common | ( | WN * | pu, |
ST * | st, | ||
STACK_OF_WN * | altentry_stack | ||
) | [static] |
Definition at line 500 of file mem_ctr.cxx.
References Be_Type_Tbl, FALSE, Gen_String_Sym(), Host_To_Targ_String(), Insert_Call(), Is_Global_Symbol(), Make_Pointer_Type(), MemCtr_Criteria_Check(), MTYPE_I8, MTYPE_STRING, MTYPE_U1, MTYPE_V, OPR_CALL, OPR_INTCONST, OPR_LDA, Parentize(), Pointer_type, Set_Call_Side_Effects(), ST_base(), ST_name(), ST_st_idx(), ST_type(), TRUE, TY_size(), WN_Create(), WN_CreateIntconst(), WN_CreateLda(), WN_CreateParm(), WN_kid0(), WN_kid1(), WN_kid2(), WN_kid3(), WN_PARM_BY_REFERENCE, WN_PARM_BY_VALUE, and WN_st_idx().
Referenced by MemCtr_Add().
static void MemCtr_Add_Global | ( | WN * | pu, |
ST * | st, | ||
STACK_OF_WN * | altentry_stack | ||
) | [static] |
Definition at line 444 of file mem_ctr.cxx.
References Be_Type_Tbl, FALSE, Gen_String_Sym(), Host_To_Targ_String(), Insert_Call(), Is_Global_Symbol(), Make_Pointer_Type(), MemCtr_Criteria_Check(), MTYPE_I8, MTYPE_STRING, MTYPE_U1, MTYPE_V, OPR_CALL, OPR_INTCONST, OPR_LDA, Parentize(), Pointer_type, Set_Call_Side_Effects(), ST_name(), ST_st_idx(), ST_type(), TRUE, TY_size(), WN_Create(), WN_CreateIntconst(), WN_CreateLda(), WN_CreateParm(), WN_kid0(), WN_kid1(), WN_kid2(), WN_PARM_BY_REFERENCE, WN_PARM_BY_VALUE, and WN_st_idx().
Referenced by MemCtr_Add().
static void MemCtr_Add_Local | ( | WN * | pu, |
ST * | st, | ||
STACK_OF_WN * | altentry_stack, | ||
STACK_OF_WN * | exit_stack | ||
) | [static] |
Definition at line 573 of file mem_ctr.cxx.
References Be_Type_Tbl, DevWarn(), FALSE, FmtAssert, Gen_String_Sym(), Get_Parent, Host_To_Targ_String(), Insert_Call(), Is_Global_Symbol(), Is_True, Is_VLA(), Make_Pointer_Type(), MemCtr_Criteria_Check(), MTYPE_I8, MTYPE_STRING, MTYPE_U1, MTYPE_V, OPR_CALL, OPR_INTCONST, OPR_INTRINSIC_CALL, OPR_LDA, OPR_LDID, OPR_PRAGMA, OPR_STID, Parentize(), Pointer_type, Set_Call_Side_Effects(), Set_Parent, ST_name(), ST_st_idx(), ST_type(), TRUE, TY_size(), WN_COPY_Tree(), WN_Create(), WN_CreateIntconst(), WN_CreateLda(), WN_CreateLdid(), WN_CreateParm(), WN_first(), WN_func_body, WN_INSERT_BlockBefore(), WN_intrinsic(), WN_kid0(), WN_kid1(), WN_kid2(), WN_kid3(), WN_next(), WN_operator(), WN_PARM_BY_REFERENCE, WN_PARM_BY_VALUE, WN_pragma(), WN_PRAGMA_PREAMBLE_END, WN_prev(), WN_st(), and WN_st_idx().
Referenced by MemCtr_Add().
static BOOL MemCtr_Criteria_Check | ( | ST * | st | ) | [static] |
Definition at line 378 of file mem_ctr.cxx.
References FALSE, memctr_size, ST_type(), TRUE, and TY_size().
Referenced by MemCtr_Add_Common(), MemCtr_Add_Global(), and MemCtr_Add_Local().
static void MemCtr_Init | ( | ) | [static] |
Definition at line 320 of file mem_ctr.cxx.
References Be_Type_Tbl, Declare_Function(), FALSE, Make_Pointer_Type(), MEM_POOL_Initialize, MTYPE_I8, MTYPE_U1, and TRUE.
Referenced by MemCtr_Add().
Definition at line 173 of file mem_ctr.cxx.
References OPC_BLOCK, OPCODE_is_leaf(), Set_Parent, WN_first(), WN_kid(), WN_kid_count(), WN_next(), and WN_opcode().
Referenced by Insert_Call(), MemCtr_Add(), MemCtr_Add_Common(), MemCtr_Add_Global(), and MemCtr_Add_Local().
static void Set_Call_Side_Effects | ( | WN * | call_wn | ) | [static] |
Definition at line 316 of file mem_ctr.cxx.
References WN_Set_Call_Parm_Ref.
Referenced by MemCtr_Add_Common(), MemCtr_Add_Global(), and MemCtr_Add_Local().
MEM_POOL memctr_pool [static] |
Definition at line 76 of file mem_ctr.cxx.
INT memctr_size = 8192 [static] |
Definition at line 63 of file mem_ctr.cxx.
Referenced by MemCtr_Criteria_Check().
WN_MAP Parent_Map = WN_MAP_UNDEFINED [static] |
Definition at line 77 of file mem_ctr.cxx.
Referenced by MemCtr_Add().
ST* reg_st_common [static] |
Definition at line 68 of file mem_ctr.cxx.
ST* reg_st_global [static] |
Definition at line 65 of file mem_ctr.cxx.
ST* reg_st_local [static] |
Definition at line 66 of file mem_ctr.cxx.
ST* unreg_st_local [static] |
Definition at line 67 of file mem_ctr.cxx.