Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include <alloca.h>
#include <unistd.h>
#include "pu_info.h"
#include "defs.h"
#include "wn.h"
#include "wn_map.h"
#include "wn_util.h"
#include "symtab.h"
#include "strtab.h"
#include "mempool.h"
#include "cxx_memory.h"
#include "erbe.h"
#include "errors.h"
#include "dwarf_DST_mem.h"
#include "clone.h"
#include "clone_DST_utils.h"
#include "dra_demangle.h"
#include "dra_internal.h"
Go to the source code of this file.
#define ONST | ( | x, | |
y | |||
) | (y) |
Definition at line 50 of file dra_clone.cxx.
Referenced by DRA_Clone_Instantiate(), DRA_Processing(), Find_Insertion_Point(), Get_Array_Type(), and Get_Original_Type().
static void DRA_Add_Clone | ( | PU_Info * | orig_pu, |
MEM_POOL * | mem_pool, | ||
STR_IDX | clone_name, | ||
char * | arg_sig, | ||
BOOL | pu_has_feedback | ||
) | [static] |
Definition at line 959 of file dra_clone.cxx.
References CLASS_FUNC, Cur_PU_Feedback, Current_DST, Current_Map_Tab, CURRENT_SYMTAB, CXX_NEW, DevWarn(), DRA_func_table, DRA_Insert_Pragmas(), DST_enter_cloned_subroutine(), DST_get_compile_unit(), FALSE, File_info, IPO_CLONE::Get_Cloned_maptab(), IPO_CLONE::Get_Cloned_PU(), IPO_SYMTAB::Get_cloned_scope_tab(), IPO_CLONE::Get_Func_ST(), IPO_CLONE::Get_sym(), MANGLED_FUNC::is_called, MANGLED_FUNC::is_clone, Malloc_Mem_Pool, MEM_pu_pool_ptr, MEM_src_pool, IPO_CLONE::New_Clone(), New_PU(), New_ST(), NULL, orig_st, PU_Info_init(), PU_Info_maptab, PU_Info_next, PU_Info_proc_sym, PU_Info_pu_dst, PU_Info_tree_ptr, PU_IS_COMPILER_GENERATED, PU_IS_DRA_CLONE, Pu_Table, Restore_Local_Symtab(), Run_cg, Save_Local_Symtab(), SCLASS_TEXT, Scope_tab, Set_FILE_INFO_has_inlines(), Set_PU_Info_depgraph_ptr, Set_PU_Info_flags, Set_PU_Info_pu_dst, Set_PU_Info_state, Set_PU_Info_symtab_ptr, Set_PU_Info_tree_ptr, Set_PU_mp_needs_lno(), Set_ST_base(), Set_ST_sclass(), MANGLED_FUNC::st, SCOPE::st, ST_base(), ST_export(), ST_Init(), ST_level(), ST_ptr(), ST_pu(), ST_st_idx(), Subsect_InMem, TRUE, WN_func_body, WN_mem_pool_ptr, WT_DEPGRAPH, WT_FREQ, WT_PROC_SYM, WT_SYMTAB, and WT_TREE.
Referenced by DRA_Clone_Instantiate().
static BOOL DRA_Clone_Initialize | ( | void | ) | [static] |
Definition at line 444 of file dra_clone.cxx.
References CXX_NEW, DRA_clone_pool, DRA_clone_table, DRA_file_mmap, DRA_FILE_SEPARATOR, DRA_func_table, DRA_Mem_Unmap_File(), DRA_Process_Requests(), MEM_POOL_Initialize, MEM_POOL_Push, MEM_src_pool, NULL, and TRUE.
Referenced by DRA_Initialize().
static void DRA_Clone_Instantiate | ( | PU_Info * | orig_pu, |
BOOL | pu_has_feedback, | ||
STRING_LIST * | tir_list, | ||
DRA_HASH_TABLE * | dra_table | ||
) | [static] |
Definition at line 695 of file dra_clone.cxx.
References DRA_Add_Clone(), DRA_New_Clone_Sig(), EC_DRA_clone_altentry, ErrMsgSrcpos(), SLIST_ITER::First(), Get_Current_PU(), Index_To_Str(), SLIST_ITER::Is_Empty(), SLIST_ITER::Next(), NULL, ONST, PU_has_altentry(), PU_Info_tree_ptr, STRING_NODE::String(), and WN_Get_Linenum().
Referenced by DRA_Processing().
static void DRA_Collect_Commons | ( | WN * | pu, |
DRA_COMMON_HASH_TABLE * | dra_common_ht | ||
) | [static] |
Definition at line 1358 of file dra_clone.cxx.
References CLASS_VAR, KIND_STRUCT, NULL, OPC_BLOCK, OPCODE_has_sym(), SCLASS_COMMON, SCLASS_DGLOBAL, ST_base(), ST_class(), ST_sclass(), ST_st_idx(), ST_type(), TRUE, TY_kind(), WN_first(), WN_kid(), WN_kid_count(), WN_next(), WN_opcode(), and WN_st().
Referenced by DRA_Processing().
void DRA_Finalize | ( | void | ) |
Definition at line 255 of file dra_clone.cxx.
References CLASS_FUNC, CLASS_NAME, CXX_DELETE, DRA_Close_File(), DRA_func_table, dra_global, EXPORT_LOCAL, FOREACH_SYMBOL, GLOBAL_SYMTAB, MANGLED_FUNC::is_called, MANGLED_FUNC::is_clone, Malloc_Mem_Pool, MEM_POOL_Delete(), MEM_POOL_Pop, New_ST(), NULL, PU_has_non_mangled_call(), Pu_Table, SCLASS_EXTERN, SCLASS_TEXT, SCLASS_UNKNOWN, Set_ST_emit_symbol(), Set_ST_export(), Set_ST_is_not_used(), Set_ST_sclass(), ST_class(), ST_Init(), ST_is_not_used(), ST_pu(), and ST_sclass().
Referenced by Phase_Fini().
static BOOL DRA_Info_Matches_Encoding | ( | DRA_INFO * | dra, |
char * | arg_sig | ||
) | [static] |
Definition at line 1710 of file dra_clone.cxx.
References 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_STAR_CODE, FALSE, FmtAssert, DRA_INFO::Num_Dims(), and TRUE.
Referenced by DRA_New_Clone_Sig().
void DRA_Initialize | ( | void | ) |
Definition at line 220 of file dra_clone.cxx.
References CXX_NEW, DRA_check_pool, DRA_Clone_Initialize(), DRA_EC_Declare_Types(), dra_global, DRA_Open_And_Map_File(), DRA_Set_Write_Location(), File_info, Malloc_Mem_Pool, MEM_POOL_Initialize, Run_Dsm_Check, Run_Dsm_Cloner, Run_Dsm_Common_Check, Set_FILE_INFO_needs_lno(), and TRUE.
Referenced by main().
static void DRA_Insert_Pragmas | ( | WN * | pu_wn, |
char * | arg_sig | ||
) | [static] |
Definition at line 1228 of file dra_clone.cxx.
References block, DISTRIBUTE_BLOCK, DISTRIBUTE_CYCLIC_CONST, DISTRIBUTE_CYCLIC_EXPR, DISTRIBUTE_STAR, DRA_BLOCK_CODE, DRA_CYCLIC_CODE, DRA_STAR_CODE, FALSE, Find_Insertion_Point(), FmtAssert, Get_Array_Type(), MTYPE_I8, OPR_LDID, ST_type(), TY_AR_const_lbnd(), TY_AR_const_ubnd(), TY_AR_lbnd_val(), TY_AR_lbnd_var(), TY_AR_ubnd_val(), TY_AR_ubnd_var(), TY_mtype(), WN_Add, WN_CreateLdid(), WN_CreatePragma(), WN_CreateXpragma(), WN_func_body, WN_INSERT_BlockAfter(), WN_Intconst(), WN_kid(), WN_pragma_arg2(), WN_pragma_distr_type(), WN_PRAGMA_DISTRIBUTE_RESHAPE, WN_pragma_index(), WN_set_pragma_compiler_generated, WN_st(), and WN_Sub.
Referenced by DRA_Add_Clone().
static char * DRA_New_Clone_Sig | ( | WN * | pu_wn, |
char * | clone_name, | ||
DRA_HASH_TABLE * | dra_table | ||
) | [static] |
Definition at line 752 of file dra_clone.cxx.
References buf, CXX_NEW_ARRAY, DRA_ARG_SEPARATOR, DRA_Demangle(), DRA_DIMS_COLUMNWISE, DRA_ESIZE_END, DRA_Info_Matches_Encoding(), DRA_MANGLE_SIG, DRA_MANGLE_SIG_LEN, DRA_NDIMS_END, EC_DRA_bad_clone_request, DRA_INFO::Element_Size(), ErrMsgSrcpos(), FmtAssert, Get_Array_Type(), KIND_ARRAY, NULL, DRA_INFO::Num_Dims(), Set_Error_Phase(), TY_AR_etype(), TY_AR_ndims(), TY_kind(), TY_size(), WN_Get_Linenum(), WN_kid(), WN_num_formals, and WN_st().
Referenced by DRA_Clone_Instantiate().
static BOOL DRA_Parse_Clone_Name | ( | char * | clone_name | ) | [static] |
Definition at line 585 of file dra_clone.cxx.
References DRA_ARG_SEPARATOR, DRA_BLOCK_CODE, DRA_CYCLIC_CODE, DRA_ESIZE_END, DRA_MANGLE_SIG, DRA_MANGLE_SIG_LEN, DRA_NDIMS_END, DRA_STAR_CODE, FALSE, NULL, and TRUE.
Referenced by DRA_Process_Requests().
static void DRA_Process_Commons | ( | DRA_HASH_TABLE * | dra_table, |
DRA_COMMON_HASH_TABLE * | dra_common_ht | ||
) | [static] |
Definition at line 1404 of file dra_clone.cxx.
References buf, DRA_INFO::Chunk_Const_Val(), DRA_INFO::Distr_Type(), DISTRIBUTE_BLOCK, DISTRIBUTE_CYCLIC_CONST, DISTRIBUTE_CYCLIC_EXPR, DISTRIBUTE_STAR, dot, DRA_BLOCK_CODE, DRA_CYCLIC_CODE, DRA_file_desc, DRA_STAR_CODE, FALSE, FOREACH_SYMBOL, GLOBAL_SYMTAB, NULL, SCLASS_COMMON, ST_base(), ST_base_idx(), ST_name(), ST_ofst(), ST_sclass(), ST_st_idx(), ST_type(), strcpy, TRUE, TY_AR_etype(), TY_AR_lbnd_val(), TY_AR_ndims(), TY_AR_ubnd_val(), TY_size(), and write.
Referenced by DRA_Processing().
static void DRA_Process_Globals | ( | DRA_HASH_TABLE * | dra_table | ) | [static] |
Definition at line 1586 of file dra_clone.cxx.
References buf, DRA_INFO::Chunk_Const_Val(), CLASS_VAR, DRA_INFO::Distr_Type(), DISTRIBUTE_BLOCK, DISTRIBUTE_CYCLIC_CONST, DISTRIBUTE_CYCLIC_EXPR, DISTRIBUTE_STAR, DRA_BLOCK_CODE, DRA_CYCLIC_CODE, DRA_file_desc, DRA_STAR_CODE, FALSE, FOREACH_SYMBOL, Get_Original_Type(), GLOBAL_SYMTAB, KIND_ARRAY, KIND_STRUCT, NULL, SCLASS_COMMON, SCLASS_DGLOBAL, ST_base(), ST_class(), ST_name(), ST_sclass(), ST_type(), strcpy, TRUE, TY_AR_etype(), TY_AR_lbnd_val(), TY_AR_ndims(), TY_AR_ubnd_val(), TY_kind(), TY_size(), and write.
Referenced by DRA_Processing().
static BOOL DRA_Process_Requests | ( | char * | tir_names | ) | [static] |
Definition at line 495 of file dra_clone.cxx.
References SLIST::Append(), CXX_NEW, DRA_clone_table, DRA_file_name, DRA_FILE_SEPARATOR, DRA_MANGLE_SIG, DRA_MANGLE_SIG_LEN, DRA_Parse_Clone_Name(), EC_DRA_rii_file_format, end_of_line, ErrMsg(), FALSE, NULL, Save_Str(), TRUE, and unlink.
Referenced by DRA_Clone_Initialize().
void DRA_Processing | ( | PU_Info * | pu_info, |
WN * | pu, | ||
BOOL | pu_has_feedback | ||
) |
Definition at line 337 of file dra_clone.cxx.
References Clear_ST_is_not_used(), CXX_DELETE, CXX_NEW, DRA_Clone_Instantiate(), DRA_clone_table, DRA_Collect_Commons(), DRA_EC_Array_Portion_Parms(), DRA_Mangle_All(), DRA_name_pool, DRA_Process_Commons(), DRA_Process_Globals(), DRA_Read_Pragmas(), FALSE, Get_Current_PU(), MEM_POOL_Delete(), MEM_POOL_Initialize, MEM_POOL_Pop, MEM_POOL_Push, NULL, ONST, OPC_ALTENTRY, PU_has_altentry(), PU_mp_needs_lno(), Pu_Table, Run_Dsm_Check, Run_Dsm_Cloner, Run_Dsm_Common_Check, Set_Error_Phase(), Set_PU_has_non_mangled_call(), Set_PU_no_inline(), ST_name_idx(), ST_pu(), WN_ITER_wn, WN_opcode(), WN_st(), WN_WALK_TreeIter(), and WN_WALK_TreeNext().
Referenced by Preorder_Process_PUs().
static WN* Find_Insertion_Point | ( | WN * | pu_wn, |
char * | arg_sig | ||
) | [static] |
Definition at line 1132 of file dra_clone.cxx.
References DRA_CYCLIC_CODE, FALSE, FmtAssert, Get_Array_Type(), Get_Current_PU(), Get_Preamble_End(), ONST, OPR_LDID, OPR_PRAGMA, OPR_STID, OPR_XPRAGMA, PU_C_LANG, PU_CXX_LANG, PU_src_lang(), ST_name(), St_Table, TRUE, TY_AR_const_ubnd(), TY_AR_ubnd_val(), TY_AR_ubnd_var(), wn, WN_first(), WN_func_body, WN_kid(), WN_kid0(), WN_next(), WN_operator(), WN_pragma(), WN_PRAGMA_PREAMBLE_END, and WN_st().
Referenced by DRA_Insert_Pragmas().
TY_IDX Get_Array_Type | ( | ST * | st | ) |
Definition at line 201 of file dra_clone.cxx.
References Get_Original_Type(), KIND_POINTER, ONST, SCLASS_AUTO, SCLASS_BASED, SCLASS_FORMAL, ST_base(), ST_base_idx(), ST_sclass(), ST_st_idx(), TY_kind(), and TY_pointed().
Referenced by DRA_Insert_Pragmas(), DRA_Mangle_Call_Site(), DRA_Mangle_Entry(), DRA_New_Clone_Sig(), DRA_Preprocess_Call_Site(), DRA_Preprocess_Entry(), DRA_Read_Pragmas_In_Block(), and Find_Insertion_Point().
TY_IDX Get_Original_Type | ( | ST * | st | ) |
Definition at line 165 of file dra_clone.cxx.
References CLASS_VAR, CXX_NEW, dra_global, DRA_GLOBAL_INFO::Get_TY(), GLOBAL_SYMTAB, Malloc_Mem_Pool, ONST, ST_class(), ST_is_reshaped(), ST_level(), and ST_type().
Referenced by DRA_Process_Globals(), and Get_Array_Type().
MEM_POOL DRA_check_pool [static] |
Definition at line 145 of file dra_clone.cxx.
Referenced by DRA_Initialize().
MEM_POOL * DRA_check_pool_ptr = NULL [static] |
Definition at line 145 of file dra_clone.cxx.
MEM_POOL DRA_clone_pool [static] |
Definition at line 143 of file dra_clone.cxx.
Referenced by DRA_Clone_Initialize().
MEM_POOL * DRA_clone_pool_ptr = NULL [static] |
Definition at line 143 of file dra_clone.cxx.
STRING_LIST_TABLE* DRA_clone_table [static] |
Definition at line 141 of file dra_clone.cxx.
Referenced by DRA_Clone_Initialize(), DRA_Process_Requests(), and DRA_Processing().
Definition at line 129 of file dra_clone.cxx.
Referenced by DRA_Add_Clone(), DRA_Clone_Initialize(), DRA_Finalize(), DRA_Mangle_All(), DRA_Mangle_Call_Site(), and DRA_Mangle_Entry().
Definition at line 133 of file dra_clone.cxx.
Referenced by DRA_Finalize(), DRA_Initialize(), and Get_Original_Type().
Definition at line 131 of file dra_clone.cxx.
Referenced by DRA_Processing().
Definition at line 131 of file dra_clone.cxx.
Referenced by New_DRA().
Definition at line 127 of file dra_clone.cxx.
Referenced by DRA_Initialize(), DRA_Processing(), Preorder_Process_PUs(), and Process_Command_Line().
Definition at line 123 of file dra_clone.cxx.
Referenced by DRA_Initialize(), DRA_Processing(), main(), Phase_Fini(), Preorder_Process_PUs(), and Process_Command_Line().
Definition at line 125 of file dra_clone.cxx.
Referenced by DRA_Initialize(), DRA_Processing(), main(), Phase_Fini(), Preorder_Process_PUs(), and Process_Command_Line().