Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#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"
Go to the source code of this file.
#define FIRST_PREG_USAGE_KIND PREG_AS_INT8 |
Definition at line 133 of file PUinfo.cxx.
Referenced by Accumulate_Preg_Info().
#define IS_RETURN_PREG | ( | wn | ) |
(ST_class(WN_st(wn)) == CLASS_PREG \ && (Is_Return_Preg(WN_load_offset(wn)) \ || WN_st(wn) == Return_Val_Preg ) )
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().
#define LAST_PREG_USAGE_KIND PREG_AS_CQ |
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] |
Definition at line 166 of file PUinfo.cxx.
Referenced by Accumulate_Preg_Info(), PUinfo_Is_Preg_Declared(), and PUinfo_Set_Preg_Declared().
#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 |
Definition at line 168 of file PUinfo.cxx.
Referenced by Accumulate_Preg_Info(), Enter_Pregs_Into_Symtab(), Get_Preg_Info(), and PUinfo_exit_pu().
#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) |
Definition at line 491 of file PUinfo.cxx.
Referenced by Accumulate_Expr_PUinfo(), Accumulate_Stmt_PUinfo(), Append_CallSite(), and Append_ReturnSite().
#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().
Definition at line 157 of file PUinfo.cxx.
typedef enum Preg_Usage_Kind PREG_USAGE_KIND |
enum Preg_Usage_Kind |
Definition at line 114 of file PUinfo.cxx.
static void Accumulate_Expr_PUinfo | ( | WN * | root | ) | [static] |
Definition at line 969 of file PUinfo.cxx.
References Accumulate_Preg_Info(), CALLSITE_call, CALLSITE_in_regs, CALLSITE_next, CALLSITE_store1, CALLSITE_store2, CLASS_PREG, IS_RETURN_PREG, Is_True, NULL, OPR_CALL, OPR_ICALL, OPR_INTRINSIC_CALL, OPR_ISTORE, OPR_LDA, OPR_LDID, OPR_PICCALL, OPR_REGION, OPR_RETURN, OPR_STID, PUinfo_Get_CallSites(), PUINFO_WN_ITER_wn, PUINFO_WN_WALK_TreeNext, RETURN_PREG_mtype, RETURN_PREG_num_pregs, RETURN_PREG_offset, ST_sym_class(), ST_type(), Stab_Mtype_To_Ty(), TRUE, W2CF_Get_Parent(), wn, WN_in_ioitem(), WN_kid0(), WN_load_offset(), WN_opc_operator, WN_operator(), WN_region_pragmas, WN_st(), WN_store_offset(), and WN_WALK_TreeIter().
Referenced by PUinfo_init_pu().
static void Accumulate_Preg_Info | ( | TY_IDX | preg_ty, |
INT16 | preg_num | ||
) | [static] |
Definition at line 283 of file PUinfo.cxx.
References FALSE, FIRST_PREG_USAGE_KIND, Free_Preg_Info, Get_Preg_Info(), Is_True, LAST_PREG_USAGE_KIND, Mtype_to_Ukind(), NULL, PREG_INFO_decl, PREG_INFO_HASH_IDX, PREG_INFO_next, PREG_INFO_preg_num, PREG_INFO_use, TRUE, TY_Is_Scalar(), TY_mtype(), and TYPE_ALLOC_N.
Referenced by Accumulate_Expr_PUinfo(), PUinfo_Is_Preg_Declared(), PUinfo_Preg_Type(), and PUinfo_Set_Preg_Declared().
static void Accumulate_Stmt_PUinfo | ( | WN * | wn | ) | [static] |
Definition at line 897 of file PUinfo.cxx.
References Append_CallSite(), Append_ReturnSite(), NULL, OPR_CALL, OPR_ICALL, OPR_INTRINSIC_CALL, OPR_PICCALL, OPR_REGION, OPR_RETURN, OPR_STID, PUINFO_WN_ITER_wn, PUINFO_WN_WALK_StmtNext, W2CF_Get_Parent(), WN_in_ioitem(), WN_opc_operator, WN_region_pragmas, and WN_WALK_StmtIter().
Referenced by PUinfo_init_pu().
static WN_ITER* Append_CallSite | ( | WN_ITER * | stmt_iter, |
const WN * | next_stmt | ||
) | [static] |
Definition at line 665 of file PUinfo.cxx.
References CLASS_PREG, Does_Stmt_Store_From_Preg(), Unparse_Target::Func_Return_Type(), Is_True, New_CallSite(), NULL, OPCODE_name(), OPR_CALL, OPR_ICALL, OPR_INTRINSIC_CALL, OPR_PICCALL, PUinfo_Get_ReturnPreg(), PUINFO_WN_ITER_wn, PUINFO_WN_WALK_StmtNext, RETURN_PREG_num_pregs, RETURN_PREG_offset, ST_pu_type(), ST_sym_class(), St_Table, Var_Stored_In(), W2X_Unparse_Target, WN_entry_name, WN_intrinsic(), WN_intrinsic_return_ty(), WN_opc_operator, WN_opcode(), and WN_ty().
Referenced by Accumulate_Stmt_PUinfo().
static WN_ITER* Append_ReturnSite | ( | WN_ITER * | stmt_iter, |
const WN * | first_stmt | ||
) | [static] |
Definition at line 795 of file PUinfo.cxx.
References CLASS_PREG, Does_Stmt_Store_Into_Preg(), New_ReturnSite(), NULL, OPR_RETURN, OPR_STID, PUINFO_WN_ITER_wn, PUINFO_WN_WALK_StmtNext, RETURN_PREG_num_pregs, RETURN_PREG_offset, ST_sym_class(), Var_Loaded_From(), WN_kid0(), and WN_opc_operator.
Referenced by Accumulate_Stmt_PUinfo().
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().
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().
static void Enter_Local_Syms_Into_Symtab | ( | const ST * | func_st | ) | [static] |
Definition at line 390 of file PUinfo.cxx.
References CLASS_FUNC, CLASS_VAR, CURRENT_SYMTAB, Unparse_Target::Enter_Symtab_Pointee_Names(), FOREACH_SYMBOL, ST_sym_class(), ST_type(), Stab_Is_Based_At_Common_Or_Equivalence(), TY_Is_Pointer(), W2CF_Symtab_Nameof_St(), W2CF_Symtab_Nameof_St_Pointee(), and W2X_Unparse_Target.
Referenced by PUinfo_init_pu().
static void Enter_Pregs_Into_Symtab | ( | void | ) | [static] |
Definition at line 333 of file PUinfo.cxx.
References LARGEST_iPREG_USAGE_KIND, LAST_PREG_USAGE_KIND, NULL, PREG_INFO_HASH_TABLE_SIZE, PREG_INFO_next, PREG_INFO_preg_num, PREG_INFO_use, SMALLEST_iPREG_USAGE_KIND, Stab_Mtype_To_Ty(), Ukind_to_Mtype, and W2CF_Symtab_Nameof_Preg().
Referenced by PUinfo_init_pu().
static PREG_INFO* Get_Preg_Info | ( | INT16 | preg_num | ) | [static] |
Definition at line 270 of file PUinfo.cxx.
References NULL, PREG_INFO_HASH_IDX, PREG_INFO_next, and PREG_INFO_preg_num.
Referenced by Accumulate_Preg_Info(), PUinfo_Is_Preg_Declared(), PUinfo_Preg_Type(), and PUinfo_Set_Preg_Declared().
static PREG_USAGE_KIND Mtype_to_Ukind | ( | MTYPE | mtype | ) | [static] |
Definition at line 199 of file PUinfo.cxx.
References FALSE, Is_True, MTYPE_C4, MTYPE_C8, MTYPE_CQ, MTYPE_F4, MTYPE_F8, MTYPE_FQ, MTYPE_I1, MTYPE_I2, MTYPE_I4, MTYPE_I8, MTYPE_U1, MTYPE_U2, MTYPE_U4, MTYPE_U8, PREG_AS_C4, PREG_AS_C8, PREG_AS_CQ, PREG_AS_IEEE32, PREG_AS_IEEE64, PREG_AS_INT16, PREG_AS_INT32, PREG_AS_INT64, PREG_AS_INT8, PREG_AS_QUAD, PREG_AS_UINT16, PREG_AS_UINT32, PREG_AS_UINT64, PREG_AS_UINT8, and PREG_AS_UNKNOWN.
Referenced by Accumulate_Preg_Info(), PUinfo_Is_Preg_Declared(), PUinfo_Preg_Type(), and PUinfo_Set_Preg_Declared().
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] |
Definition at line 584 of file PUinfo.cxx.
References CALLSITE_call, CallSite_Free, CALLSITE_in_regs, CALLSITE_next, CALLSITE_return_ty, CALLSITE_return_var, CALLSITE_store1, CALLSITE_store2, CALLSITE_var_offset, FALSE, NULL, and TYPE_ALLOC_N.
Referenced by Append_CallSite().
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] |
Definition at line 626 of file PUinfo.cxx.
References NULL, ReturnSite_Free, RETURNSITE_next, RETURNSITE_return, RETURNSITE_return_var, RETURNSITE_store1, RETURNSITE_store2, RETURNSITE_var_offset, and TYPE_ALLOC_N.
Referenced by Append_ReturnSite().
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().
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().
CALLSITE* PUinfo_Get_CallSites | ( | void | ) |
Definition at line 1328 of file PUinfo.cxx.
References CallSite_First.
Referenced by Accumulate_Expr_PUinfo(), WN2C_call(), WN2F_call(), and WN2F_intrinsic_call().
RETURN_PREG PUinfo_Get_ReturnPreg | ( | TY_IDX | return_ty | ) |
Definition at line 1342 of file PUinfo.cxx.
References Fail_FmtAssertion(), Get_Return_Info(), Get_Return_Mtypes(), Get_Return_Pregs(), MTYPE_V, RETURN_INFO_count(), RETURN_INFO_mtype(), RETURN_INFO_preg(), RETURN_PREG_mtype, RETURN_PREG_num_pregs, RETURN_PREG_offset, Use_Simulated, and WHIRL_Return_Info_On.
Referenced by Append_CallSite(), PUinfo_init_pu(), WN2C_Function_Call_Lhs(), and WN2F_Function_Call_Lhs().
RETURNSITE* PUinfo_Get_ReturnSites | ( | void | ) |
Definition at line 1335 of file PUinfo.cxx.
References ReturnSite_First.
Referenced by WN2C_func_entry(), and WN2F_Enter_PU_Block().
void PUinfo_init_pu | ( | const WN * | pu, |
WN * | body_part_of_interest | ||
) |
Definition at line 1143 of file PUinfo.cxx.
References Accumulate_Expr_PUinfo(), Accumulate_Stmt_PUinfo(), Enter_Local_Syms_Into_Symtab(), Enter_Pregs_Into_Symtab(), Is_True, New_Token_Buffer(), NULL, OPCODE_is_expression(), OPR_FUNC_ENTRY, PUinfo_Get_ReturnPreg(), PUINFO_RETURN_TY, St_Table, W2CF_Symtab_Push(), WN_entry_name, WN_opcode(), and WN_operator().
Referenced by W2C_Push_PU(), and W2F_Push_PU().
void PUinfo_initialize | ( | void | ) |
Definition at line 1107 of file PUinfo.cxx.
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().
TY_IDX PUinfo_Preg_Type | ( | TY_IDX | preg_ty, |
INT16 | preg_num | ||
) |
Definition at line 1257 of file PUinfo.cxx.
References Accumulate_Preg_Info(), Get_Preg_Info(), LARGEST_iPREG_USAGE_KIND, Mtype_to_Ukind(), NULL, PREG_INFO_use, Stab_Mtype_To_Ty(), TY_Is_Integral(), TY_mtype(), and Ukind_to_Mtype.
Referenced by ST2C_Use_Preg(), ST2F_Use_Preg(), WN2C_Append_Preg(), WN2C_Function_Call_Lhs(), WN2C_Function_Return_Value(), WN2C_ldid(), WN2C_stid_lhs(), and WN2F_ldid().
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().
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().
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().
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().
CALLSITE* CallSite_First = NULL [static] |
Definition at line 498 of file PUinfo.cxx.
Referenced by PUinfo_Get_CallSites().
CALLSITE* CallSite_Free = NULL [static] |
Definition at line 500 of file PUinfo.cxx.
Referenced by New_CallSite(), PUinfo_exit_pu(), and PUinfo_finalize().
CALLSITE* CallSite_Last = NULL [static] |
Definition at line 499 of file PUinfo.cxx.
PREG_INFO* Free_Preg_Info = NULL [static] |
Definition at line 175 of file PUinfo.cxx.
Referenced by Accumulate_Preg_Info(), and PUinfo_exit_pu().
PREG_INFO* Preg_Info_Hash_Tbl[PREG_INFO_HASH_TABLE_SIZE] [static] |
Definition at line 174 of file PUinfo.cxx.
Definition at line 86 of file PUinfo.cxx.
Referenced by Check_PU_Pushed(), W2C_Outfile_Translate_Pu(), W2F_Outfile_Translate_Pu(), WN2F_ldid(), WN2F_Offset_Symref(), and WN2F_return().
Definition at line 88 of file PUinfo.cxx.
Referenced by ST2C_Declare_Tempvar(), ST2C_Define_Preg(), ST2F_Declare_Tempvar(), ST2F_Define_Preg(), WN2C_block(), WN2F_Append_Block_Data(), and WN2F_Exit_PU_Block().
Definition at line 90 of file PUinfo.cxx.
Referenced by INIT2F_Implied_DoLoop(), ST2C_Declare_Tempvar(), ST2C_Define_Preg(), ST2F_Declare_Tempvar(), ST2F_Define_Preg(), TY2F_Translate_Structure(), WN2C_block(), and WN2F_func_entry().
Definition at line 89 of file PUinfo.cxx.
Referenced by Emit_To_PUinfo_Pragmas(), WN2C_block(), WN2C_func_entry(), WN2F_Exit_PU_Block(), and WN2F_func_entry().
Definition at line 87 of file PUinfo.cxx.
Referenced by WN2C_Function_Return_Value(), WN2C_return(), and WN2F_return().
RETURNSITE* ReturnSite_First = NULL [static] |
Definition at line 502 of file PUinfo.cxx.
Referenced by PUinfo_Get_ReturnSites().
RETURNSITE* ReturnSite_Free = NULL [static] |
Definition at line 504 of file PUinfo.cxx.
Referenced by New_ReturnSite(), PUinfo_exit_pu(), and PUinfo_finalize().
RETURNSITE* ReturnSite_Last = NULL [static] |
Definition at line 503 of file PUinfo.cxx.
const MTYPE Ukind_to_Mtype[LAST_PREG_USAGE_KIND+1] [static] |
{ MTYPE_UNKNOWN, MTYPE_I1, MTYPE_U1, MTYPE_I2, MTYPE_U2, MTYPE_I4, MTYPE_U4, MTYPE_I8, MTYPE_U8, MTYPE_F4, MTYPE_F8, MTYPE_FQ, MTYPE_C4, MTYPE_C8, MTYPE_CQ }
Definition at line 138 of file PUinfo.cxx.
Referenced by Enter_Pregs_Into_Symtab(), and PUinfo_Preg_Type().