Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
Go to the source code of this file.
#define INIT_MAP_SIZE 20 |
Definition at line 101 of file wn_map.cxx.
Referenced by WN_MAP_realloc_array().
#define WN_MAP_check_kind | ( | maptab, | |
wn_map, | |||
kind | |||
) | ((maptab)->_kind[(wn_map)] == (kind)) |
Definition at line 116 of file wn_map.cxx.
Referenced by IPA_WN_MAP32_Get(), IPA_WN_MAP32_Set(), IPA_WN_MAP64_Get(), IPA_WN_MAP64_Set(), IPA_WN_MAP_Get(), and IPA_WN_MAP_Set().
INT32 IPA_WN_MAP32_Get | ( | WN_MAP_TAB * | maptab, |
WN_MAP | wn_map, | ||
const WN * | wn | ||
) |
Definition at line 430 of file wn_map.cxx.
References wn_map_tab::_is_used, wn_map_tab::_map_size, wn_map_tab::_mapping, Is_True, OPCODE_mapcat(), WN_MAP_check_kind, WN_map_id(), WN_MAP_KIND_INT32, and WN_opcode().
void IPA_WN_MAP32_Set | ( | WN_MAP_TAB * | maptab, |
WN_MAP | wn_map, | ||
WN * | wn, | ||
INT32 | thing | ||
) |
Definition at line 372 of file wn_map.cxx.
References wn_map_tab::_is_used, wn_map_tab::_map_size, wn_map_tab::_mapping, Is_True, OPCODE_mapcat(), WN_MAP_check_kind, WN_MAP_get_map_id(), WN_MAP_KIND_INT32, WN_MAP_realloc_array(), and WN_opcode().
Referenced by FEEDBACK::Delete(), and IPA_WN_Move_Maps_PU().
INT64 IPA_WN_MAP64_Get | ( | WN_MAP_TAB * | maptab, |
WN_MAP | wn_map, | ||
const WN * | wn | ||
) |
Definition at line 447 of file wn_map.cxx.
References wn_map_tab::_is_used, wn_map_tab::_map_size, wn_map_tab::_mapping, Is_True, OPCODE_mapcat(), WN_MAP_check_kind, WN_map_id(), WN_MAP_KIND_INT64, and WN_opcode().
void IPA_WN_MAP64_Set | ( | WN_MAP_TAB * | maptab, |
WN_MAP | wn_map, | ||
WN * | wn, | ||
INT64 | thing | ||
) |
Definition at line 390 of file wn_map.cxx.
References wn_map_tab::_is_used, wn_map_tab::_map_size, wn_map_tab::_mapping, Is_True, OPCODE_mapcat(), WN_MAP_check_kind, WN_MAP_get_map_id(), WN_MAP_KIND_INT64, WN_MAP_realloc_array(), and WN_opcode().
Referenced by IPA_WN_Move_Maps_PU().
void IPA_WN_MAP_Delete | ( | WN_MAP_TAB * | maptab, |
WN_MAP | wn_map | ||
) |
Definition at line 236 of file wn_map.cxx.
References wn_map_tab::_is_used, wn_map_tab::_map_size, wn_map_tab::_mapping, wn_map_tab::_pool, FALSE, Is_True, Malloc_Mem_Pool, MEM_POOL_FREE, NULL, WN_MAP_CATEGORIES, and WN_MAP_MAX.
Referenced by WN_MAP_TAB_Delete().
void* IPA_WN_MAP_Get | ( | WN_MAP_TAB * | maptab, |
WN_MAP | wn_map, | ||
const WN * | wn | ||
) |
Definition at line 413 of file wn_map.cxx.
References wn_map_tab::_is_used, wn_map_tab::_map_size, wn_map_tab::_mapping, Is_True, NULL, OPCODE_mapcat(), WN_MAP_check_kind, WN_map_id(), WN_MAP_KIND_VOIDP, and WN_opcode().
void IPA_WN_MAP_Set | ( | WN_MAP_TAB * | maptab, |
WN_MAP | wn_map, | ||
WN * | wn, | ||
void * | thing | ||
) |
Definition at line 352 of file wn_map.cxx.
References wn_map_tab::_is_used, wn_map_tab::_map_size, wn_map_tab::_mapping, Is_True, NULL, OPCODE_mapcat(), WN_MAP_check_kind, WN_MAP_get_map_id(), WN_MAP_KIND_VOIDP, WN_MAP_realloc_array(), and WN_opcode().
Referenced by IPO_CLONE::Clone_Tree(), and IPA_WN_Move_Maps_PU().
WN_MAP_ID IPA_WN_MAP_Status | ( | WN_MAP_TAB * | maptab | ) |
Definition at line 259 of file wn_map.cxx.
References wn_map_tab::_is_used, Is_True, WN_MAP_MAX, and WN_MAP_RESERVED.
void WN_MAP_Add_Free_List | ( | WN_MAP_TAB * | maptab, |
WN * | wn | ||
) |
Definition at line 470 of file wn_map.cxx.
References wn_map_tab::_free_list, wn_map_tab::_free_list_count, wn_map_tab::_free_list_pool, wn_map_tab::_free_list_size, max, OPCODE_mapcat(), size, TYPE_MEM_POOL_ALLOC_N, TYPE_MEM_POOL_REALLOC_N, WN_map_id(), and WN_opcode().
Referenced by IPA_WN_Delete(), and IPA_WN_Move_Maps_PU().
WN_MAP WN_MAP_Do_Create | ( | WN_MAP_TAB * | maptab, |
MEM_POOL * | pool, | ||
WN_MAP_KIND | kind | ||
) |
Definition at line 204 of file wn_map.cxx.
References wn_map_tab::_is_used, wn_map_tab::_kind, wn_map_tab::_map_size, wn_map_tab::_mapping, wn_map_tab::_pool, FmtAssert, kind, NULL, pool, TRUE, WN_MAP_CATEGORIES, WN_MAP_MAX, and WN_MAP_RESERVED.
WN_MAP_ID WN_MAP_get_map_id | ( | WN_MAP_TAB * | maptab, |
OPERATOR_MAPCAT | category, | ||
WN * | wn | ||
) | [static] |
Definition at line 281 of file wn_map.cxx.
References wn_map_tab::_free_list, wn_map_tab::_free_list_count, wn_map_tab::_is_used, wn_map_tab::_kind, wn_map_tab::_last_map_id, wn_map_tab::_mapping, FALSE, Is_True, NULL, WN_map_id(), WN_MAP_KIND_INT32, WN_MAP_KIND_INT64, WN_MAP_KIND_VOIDP, and WN_MAP_MAX.
Referenced by IPA_WN_MAP32_Set(), IPA_WN_MAP64_Set(), IPA_WN_MAP_Set(), and WN_MAP_Set_ID().
void WN_MAP_realloc_array | ( | WN_MAP_TAB * | maptab, |
OPERATOR_MAPCAT | category, | ||
WN_MAP | wn_map, | ||
WN_MAP_ID | id, | ||
INT32 | elemsz | ||
) | [static] |
Definition at line 322 of file wn_map.cxx.
References wn_map_tab::_map_size, wn_map_tab::_mapping, wn_map_tab::_pool, mem_pool::bz, INIT_MAP_SIZE, and MEM_POOL_Realloc.
Referenced by IPA_WN_MAP32_Set(), IPA_WN_MAP64_Set(), and IPA_WN_MAP_Set().
void WN_MAP_Set_ID | ( | WN_MAP_TAB * | maptab, |
WN * | wn | ||
) |
Definition at line 506 of file wn_map.cxx.
References OPCODE_mapcat(), WN_MAP_get_map_id(), and WN_opcode().
Referenced by IPA_WN_Move_Maps_PU().
WN_MAP_TAB* WN_MAP_TAB_Create | ( | MEM_POOL * | pool | ) |
Definition at line 127 of file wn_map.cxx.
References wn_map_tab::_free_list_count, wn_map_tab::_free_list_pool, wn_map_tab::_free_list_size, wn_map_tab::_is_used, wn_map_tab::_kind, wn_map_tab::_last_map_id, wn_map_tab::_map_size, wn_map_tab::_mapping, wn_map_tab::_pool, FALSE, NULL, pool, TRUE, TYPE_MEM_POOL_ALLOC, WN_MAP_AC_INTERNAL, WN_MAP_ALIAS_CLASS, WN_MAP_CATEGORIES, WN_MAP_DEPGRAPH, WN_MAP_FEEDBACK, WN_MAP_KIND_INT32, WN_MAP_KIND_VOIDP, WN_MAP_MAX, WN_MAP_PREFETCH, and WN_MAP_RESERVED.
Referenced by IPO_CLONE::New_Clone(), PDGCS_initialize(), and Read_Local_Info().
void WN_MAP_TAB_Delete | ( | WN_MAP_TAB * | maptab | ) |
Definition at line 175 of file wn_map.cxx.
References wn_map_tab::_free_list, wn_map_tab::_free_list_pool, wn_map_tab::_free_list_size, wn_map_tab::_is_used, IPA_WN_MAP_Delete(), MEM_POOL_FREE, WN_MAP_CATEGORIES, and WN_MAP_MAX.
Referenced by Free_Local_Info().
Mapping mechanism for tree nodes --------------------------------
Description:
This module implements the mapping mechanism. Its interface is described in wn_map.h
Implementation Description The interface/external behavior of the mapping routines is described in wn_map.h. Here we describe the implementation.
The set of possible opcodes is partitioned into categories. We provide a separate mapping mechanism for each category, although this is transparent to the user. When the user creates a mapping, no memory is allocated. We instead use a lazy model that allocates space when the user first sets the value for a node. Thus, while the same mapping can be used by opcodes in different categories, space is only reserved for those categores that have opcodes which are set. As an example, the user may create a data dependence mapping. If he only sets the mappings for loads and stores, memory will only be allocated for all the load/store nodes.
Each wn_map has a WN_MAP_KIND flag to indicate what kind of values it holds. They may be void*, INT32, or INT64 values.
Every WN contains a map_id. This map_id is unique among all nodes of the same category in one PU. Two nodes of different categories or in different PUs may share the same map_id. Every node has its map_id initialized to -1. A node only gets a valid map_id when it is assigned a value for one of the maps. This allows us to avoid wasting map_id space on nodes that are never mapped.
To save space, we retain a free list of map_ids. When a WN is deleted, the WN_MAP_Add_Free_List method is called automatically to add the map_id to the free list. If we later need a new map_id, we can just grab a value off the free list.
Definition at line 99 of file wn_map.cxx.
Referenced by DRA_Add_Clone(), fix_tree(), ir_put_wn(), PDGCS_initialize(), PDGCS_new_proc(), Postprocess_PU(), Preprocess_PU(), Read_Local_Info(), WN_COPY_All_Maps(), WN_CopyMap(), WN_get_prefetch(), WN_get_tree(), and Write_PU_Info().