Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include <alloca.h>
#include <elf.h>
#include "defs.h"
#include "wn.h"
#include "stab.h"
#include "pu_info.h"
#include "opcode.h"
#include "mempool.h"
#include "cxx_memory.h"
#include "wn_pragmas.h"
#include "config_targ.h"
#include "targ_sim.h"
#include "erbe.h"
#include "strtab.h"
#include "wn_util.h"
#include "dwarf_DST.h"
#include "config.h"
#include "dra_internal.h"
Go to the source code of this file.
Functions | |
static DRA_INFO * | New_DRA (WN **pwn_addr, ST *array_st, TY_IDX array_ty, WN *block, WN *preamble) |
static BOOL | Array_TY_OK (TY_IDX array_ty) |
static void | Insert_Alloca (ST *array_st, INT16 ndims, INT64 esize, WN *dim_size_wn[], WN *block, WN *preamble) |
static WN * | Delete_Dist_Reshape_Pragmas (WN *pwn, WN *block) |
static void | DRA_Mangle_Entry (WN *entry_wn, INT16 num_formals, DRA_HASH_TABLE *dra_table, DST_ASSOC_INFO *assoc_info) |
static void | DRA_Mangle_Call_Site (WN *call_wn, OPERATOR call_oper, DRA_HASH_TABLE *dra_table) |
static UINT | DRA_Preprocess_Entry (WN *entry_wn, INT16 num_formals, DRA_HASH_TABLE *dra_table, BOOL *has_reshaped_formals) |
static UINT | DRA_Preprocess_Call_Site (WN *call_wn, INT16 num_args, DRA_HASH_TABLE *dra_table, BOOL *has_reshaped_args) |
static char * | DRA_Insert_Mangling_Sigs (char *orig_name, char mangled_buf[]) |
static char * | DRA_Encode_Parameter (ST *st, TY_IDX ty, char *buf, DRA_HASH_TABLE *dra_table) |
static void | DRA_Read_Pragmas_In_Block (WN *first, WN *block, WN *preamble, DRA_HASH_TABLE *dra_table) |
void | DRA_Read_Pragmas (WN *func_nd, DRA_HASH_TABLE *dra_table) |
void | DRA_Mangle_All (WN *func_wn, DRA_HASH_TABLE *dra_table, PU_Info *pu_info) |
WN * | Get_Preamble_End (WN *entry_wn) |
ST * | Find_Return_Registers (TYPE_ID type, PREG_NUM *rreg1, PREG_NUM *rreg2) |
static void | Change_ST_Of_Current_PU (ST *new_entry_st) |
static BOOL Array_TY_OK | ( | TY_IDX | array_ty | ) | [static] |
Definition at line 561 of file dra_mangle.cxx.
References FALSE, Is_True, KIND_ARRAY, TRUE, WN::ty, TY_AR_const_lbnd(), TY_AR_const_ubnd(), TY_AR_lbnd_val(), TY_AR_ndims(), TY_AR_ubnd_val(), TY_kind(), and Ty_Table.
Referenced by DRA_Read_Pragmas_In_Block().
static void Change_ST_Of_Current_PU | ( | ST * | new_entry_st | ) | [static] |
Definition at line 725 of file dra_mangle.cxx.
References Current_PU_Info, CURRENT_SYMTAB, pu_info::proc_sym, Scope_tab, SCOPE::st, and ST_st_idx().
Referenced by DRA_Mangle_Entry().
static WN * Delete_Dist_Reshape_Pragmas | ( | WN * | pwn, |
WN * | block | ||
) | [static] |
Definition at line 676 of file dra_mangle.cxx.
References FmtAssert, next, NULL, OPC_PRAGMA, OPC_XPRAGMA, WN_DELETE_FromBlock(), WN_next(), WN_opcode(), WN_pragma(), WN_PRAGMA_DISTRIBUTE_RESHAPE, and WN_st().
Referenced by DRA_Read_Pragmas_In_Block(), and New_DRA().
static char * DRA_Encode_Parameter | ( | ST * | st, |
TY_IDX | ty, | ||
char * | buf, | ||
DRA_HASH_TABLE * | dra_table | ||
) | [static] |
Definition at line 1162 of file dra_mangle.cxx.
References ARB_dimension(), buf, DRA_INFO::Chunk_Const_Val(), DRA_INFO::Distr_Type(), DISTRIBUTE_BLOCK, DISTRIBUTE_CYCLIC_CONST, DISTRIBUTE_CYCLIC_EXPR, DISTRIBUTE_STAR, DRA_BLOCK_CODE, DRA_CYCLIC_CODE, DRA_ESIZE_END, DRA_NDIMS_END, DRA_STAR_CODE, KIND_ARRAY, NULL, size, WN::ty, TY_arb(), TY_etype(), TY_kind(), TY_size(), and Ty_Table.
Referenced by DRA_Mangle_Call_Site(), and DRA_Mangle_Entry().
static char * DRA_Insert_Mangling_Sigs | ( | char * | orig_name, |
char | mangled_buf[] | ||
) | [static] |
Definition at line 1124 of file dra_mangle.cxx.
References DRA_MANGLE_SIG, DRA_MANGLE_SIG_LEN, and strcpy.
Referenced by DRA_Mangle_Call_Site(), and DRA_Mangle_Entry().
void DRA_Mangle_All | ( | WN * | func_wn, |
DRA_HASH_TABLE * | dra_table, | ||
PU_Info * | pu_info | ||
) |
Definition at line 270 of file dra_mangle.cxx.
References CXX_NEW, DRA_func_table, DRA_Mangle_Call_Site(), DRA_Mangle_Entry(), DST_ASSOC_INFO_st_index, DST_ATTR_IDX_TO_PTR, DST_ENTRY_POINT_st, DST_INFO_attributes, DST_INFO_IDX_TO_PTR, DST_INFO_sibling, DST_INFO_tag, DST_IS_NULL, DST_SUBPROGRAM_def_st, DW_TAG_entry_point, MEM_src_pool, NULL, OPC_ALTENTRY, OPR_CALL, OPR_ICALL, PU_Info_pu_dst, ST_index(), WN_ITER_wn, WN_kid_count(), WN_num_formals, WN_opcode(), WN_operator(), WN_st(), WN_WALK_TreeIter(), and WN_WALK_TreeNext().
Referenced by DRA_Processing().
static void DRA_Mangle_Call_Site | ( | WN * | call_wn, |
OPERATOR | call_oper, | ||
DRA_HASH_TABLE * | dra_table | ||
) | [static] |
Definition at line 855 of file dra_mangle.cxx.
References arg, Clear_ST_is_not_used(), Copy_ST(), CXX_NEW, DRA_ARG_SEPARATOR, DRA_Encode_Parameter(), DRA_func_table, DRA_Insert_Mangling_Sigs(), DRA_Preprocess_Call_Site(), EC_DRA_indirect_call, ErrMsgSrcpos(), FALSE, Get_Array_Type(), MANGLED_FUNC::is_called, MEM_src_pool, New_PU(), NULL, OPR_CALL, OPR_ICALL, OPR_LDA, OPR_LDID, PU_has_non_mangled_call(), Pu_Table, Save_Str(), SCLASS_EXTERN, Set_PU_has_non_mangled_call(), Set_PU_no_inline(), Set_ST_base(), Set_ST_is_not_used(), Set_ST_name, Set_ST_ofst(), Set_ST_pu(), Set_ST_sclass(), MANGLED_FUNC::st, ST_name(), ST_name_idx(), ST_pu(), ST_st_idx(), TRUE, WN_actual, WN_Get_Linenum(), WN_kid(), WN_num_actuals(), WN_operator(), WN_st(), and WN_st_idx().
Referenced by DRA_Mangle_All().
static void DRA_Mangle_Entry | ( | WN * | entry_wn, |
INT16 | num_formals, | ||
DRA_HASH_TABLE * | dra_table, | ||
DST_ASSOC_INFO * | assoc_info | ||
) | [static] |
Definition at line 744 of file dra_mangle.cxx.
References Change_ST_Of_Current_PU(), Clear_ST_is_not_used(), Copy_ST(), CXX_NEW, DRA_ARG_SEPARATOR, DRA_Encode_Parameter(), DRA_func_table, DRA_Insert_Mangling_Sigs(), DRA_Preprocess_Entry(), FALSE, Get_Array_Type(), MANGLED_FUNC::is_called, MANGLED_FUNC::is_clone, MEM_src_pool, NULL, pDST_ASSOC_INFO_st_idx, PU_has_non_mangled_call(), Pu_Table, Run_cg, Save_Str(), SCLASS_EXTERN, SCLASS_TEXT, Set_PU_has_non_mangled_call(), Set_ST_base(), Set_ST_is_not_used(), Set_ST_name, Set_ST_sclass(), MANGLED_FUNC::st, ST_base(), ST_name(), ST_name_idx(), ST_pu(), ST_st_idx(), TRUE, WN_formal, WN_st(), and WN_st_idx().
Referenced by DRA_Mangle_All().
static UINT DRA_Preprocess_Call_Site | ( | WN * | call_wn, |
INT16 | num_args, | ||
DRA_HASH_TABLE * | dra_table, | ||
BOOL * | has_reshaped_args | ||
) | [static] |
Definition at line 1062 of file dra_mangle.cxx.
References arg, DRA_MANGLE_SIG_LEN, Get_Array_Type(), KIND_ARRAY, NULL, OPR_CALL, OPR_LDA, OPR_LDID, ST_name(), TRUE, TY_AR_ndims(), TY_kind(), Ty_Table, WN_actual, WN_kid(), WN_operator(), and WN_st().
Referenced by DRA_Mangle_Call_Site().
static UINT DRA_Preprocess_Entry | ( | WN * | entry_wn, |
INT16 | num_formals, | ||
DRA_HASH_TABLE * | dra_table, | ||
BOOL * | has_reshaped_formals | ||
) | [static] |
Definition at line 1015 of file dra_mangle.cxx.
References DRA_MANGLE_SIG_LEN, Get_Array_Type(), KIND_ARRAY, NULL, ST_name(), TRUE, TY_AR_ndims(), TY_kind(), Ty_Table, WN_formal, and WN_st().
Referenced by DRA_Mangle_Entry().
void DRA_Read_Pragmas | ( | WN * | func_nd, |
DRA_HASH_TABLE * | dra_table | ||
) |
Definition at line 242 of file dra_mangle.cxx.
References block, DRA_Read_Pragmas_In_Block(), Get_Preamble_End(), Set_Error_Phase(), and WN_func_body.
Referenced by DRA_Processing().
static void DRA_Read_Pragmas_In_Block | ( | WN * | first, |
WN * | block, | ||
WN * | preamble, | ||
DRA_HASH_TABLE * | dra_table | ||
) | [static] |
Definition at line 142 of file dra_mangle.cxx.
References Array_TY_OK(), CLASS_VAR, Delete_Dist_Reshape_Pragmas(), EC_DRA_unsupported_type, ErrMsgSrcpos(), WN::first, FmtAssert, Get_Array_Type(), KIND_ARRAY, New_DRA(), NULL, OPC_PRAGMA, OPC_REGION, SCLASS_DGLOBAL, ST_class(), ST_is_equivalenced(), ST_is_initialized(), ST_is_not_used(), ST_name(), ST_sclass(), TY_kind(), WN_first(), WN_Get_Linenum(), WN_next(), WN_opcode(), WN_pragma(), WN_PRAGMA_DISTRIBUTE_RESHAPE, WN_region_body, and WN_st().
Referenced by DRA_Read_Pragmas().
ST* Find_Return_Registers | ( | TYPE_ID | type, |
PREG_NUM * | rreg1, | ||
PREG_NUM * | rreg2 | ||
) |
Definition at line 379 of file dra_mangle.cxx.
References Be_Type_Tbl, Fail_FmtAssertion(), Float32_Preg, Float64_Preg, Get_Return_Info(), Get_Return_Mtypes(), Get_Return_Pregs(), Int32_Preg, Int64_Preg, MTYPE_bit_size, NULL, Preg_Offset_Is_Int, RETURN_INFO_count(), RETURN_INFO_preg(), Use_Simulated, and WHIRL_Return_Info_On.
Referenced by Gen_Call_Array(), Gen_Malloc_Cart(), and Insert_Alloca().
WN* Get_Preamble_End | ( | WN * | entry_wn | ) |
Definition at line 342 of file dra_mangle.cxx.
References Is_True, NULL, OPC_ALTENTRY, OPC_FUNC_ENTRY, OPC_PRAGMA, wn, WN_entry_first, WN_next(), WN_opcode(), WN_pragma(), and WN_PRAGMA_PREAMBLE_END.
Referenced by DRA_EC_Array_Portion_Parms(), DRA_Read_Pragmas(), and Find_Insertion_Point().
static void Insert_Alloca | ( | ST * | array_st, |
INT16 | ndims, | ||
INT64 | esize, | ||
WN * | dim_size_wn[], | ||
WN * | block, | ||
WN * | preamble | ||
) | [static] |
Definition at line 601 of file dra_mangle.cxx.
References Be_Type_Tbl, Find_Return_Registers(), FmtAssert, Get_Current_PU(), MTYPE_I8, MTYPE_V, OPR_INTRINSIC_CALL, OPR_LDID, OPR_STID, Pointer_Size, Pointer_type, Set_PU_has_alloca(), Set_ST_pt_to_unique_mem(), ST_type(), WN_CopyNode(), WN_Create(), WN_CreateLdid(), WN_CreateParm(), WN_CreateStid(), WN_INSERT_BlockBefore(), WN_Intconst(), WN_intrinsic(), WN_kid0(), WN_Mpy, and WN_PARM_BY_REFERENCE.
Referenced by New_DRA().
static DRA_INFO * New_DRA | ( | WN ** | pwn_addr, |
ST * | array_st, | ||
TY_IDX | array_ty, | ||
WN * | block, | ||
WN * | preamble | ||
) | [static] |
Definition at line 449 of file dra_mangle.cxx.
References CXX_NEW, Delete_Dist_Reshape_Pragmas(), DISTRIBUTE_BLOCK, DISTRIBUTE_CYCLIC_CONST, DISTRIBUTE_CYCLIC_EXPR, DISTRIBUTE_STAR, DRA_name_pool_ptr, EC_DRA_all_stars, ErrMsgSrcpos(), FALSE, FmtAssert, DRA_INFO::Init(), Insert_Alloca(), KIND_POINTER, NULL, OPC_PRAGMA, OPC_XPRAGMA, SCLASS_AUTO, ST_name(), ST_sclass(), ST_type(), WN::ty, TY_AR_etype(), TY_AR_ndims(), TY_kind(), TY_size(), Ty_Table, WN_Get_Linenum(), WN_kid(), WN_next(), WN_opcode(), WN_pragma(), WN_pragma_arg2(), WN_pragma_distr_type(), and WN_PRAGMA_DISTRIBUTE_RESHAPE.
Referenced by DRA_Read_Pragmas_In_Block().