Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
wn_map.cxx File Reference
#include <string.h>
#include "wn.h"
Include dependency graph for wn_map.cxx:

Go to the source code of this file.

Defines

#define INIT_MAP_SIZE   20
#define WN_MAP_check_kind(maptab, wn_map, kind)   ((maptab)->_kind[(wn_map)] == (kind))

Functions

static WN_MAP_ID WN_MAP_get_map_id (WN_MAP_TAB *maptab, OPERATOR_MAPCAT category, WN *wn)
static void WN_MAP_realloc_array (WN_MAP_TAB *maptab, OPERATOR_MAPCAT category, WN_MAP wn_map, WN_MAP_ID id, INT32 elemsz)
WN_MAP_TABWN_MAP_TAB_Create (MEM_POOL *pool)
void WN_MAP_TAB_Delete (WN_MAP_TAB *maptab)
WN_MAP WN_MAP_Do_Create (WN_MAP_TAB *maptab, MEM_POOL *pool, WN_MAP_KIND kind)
void IPA_WN_MAP_Delete (WN_MAP_TAB *maptab, WN_MAP wn_map)
WN_MAP_ID IPA_WN_MAP_Status (WN_MAP_TAB *maptab)
void IPA_WN_MAP_Set (WN_MAP_TAB *maptab, WN_MAP wn_map, WN *wn, void *thing)
void IPA_WN_MAP32_Set (WN_MAP_TAB *maptab, WN_MAP wn_map, WN *wn, INT32 thing)
void IPA_WN_MAP64_Set (WN_MAP_TAB *maptab, WN_MAP wn_map, WN *wn, INT64 thing)
void * IPA_WN_MAP_Get (WN_MAP_TAB *maptab, WN_MAP wn_map, const WN *wn)
INT32 IPA_WN_MAP32_Get (WN_MAP_TAB *maptab, WN_MAP wn_map, const WN *wn)
INT64 IPA_WN_MAP64_Get (WN_MAP_TAB *maptab, WN_MAP wn_map, const WN *wn)
void WN_MAP_Add_Free_List (WN_MAP_TAB *maptab, WN *wn)
void WN_MAP_Set_ID (WN_MAP_TAB *maptab, WN *wn)

Variables

WN_MAP_TABCurrent_Map_Tab = NULL

Define Documentation

#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))

Function Documentation

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().

Here is the call graph for this function:

void IPA_WN_MAP32_Set ( WN_MAP_TAB maptab,
WN_MAP  wn_map,
WN wn,
INT32  thing 
)
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().

Here is the call graph for this function:

void IPA_WN_MAP64_Set ( WN_MAP_TAB maptab,
WN_MAP  wn_map,
WN wn,
INT64  thing 
)
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().

Here is the call graph for this function:

void IPA_WN_MAP_Set ( WN_MAP_TAB maptab,
WN_MAP  wn_map,
WN wn,
void *  thing 
)

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_realloc_array ( WN_MAP_TAB maptab,
OPERATOR_MAPCAT  category,
WN_MAP  wn_map,
WN_MAP_ID  id,
INT32  elemsz 
) [static]
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().

Here is the call graph for this function:


Variable Documentation

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().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines