Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
wn_map.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wn_map_tab

Defines

#define WN_MAP_UNDEFINED   (-1)
#define WN_MAP_DEPGRAPH   0
#define WN_MAP_PREFETCH   1
#define WN_MAP_FEEDBACK   2
#define WN_MAP_AC_INTERNAL   3
#define WN_MAP_ALIAS_CLASS   4
#define WN_MAP_RESERVED   5
#define WN_MAP_MAX   28
#define WN_MAP_TAB_Last_ID(maptab, category)   (maptab)->_last_map_id[(category)]
#define WN_MAP_Create(pool)   WN_MAP_Do_Create(Current_Map_Tab, (pool), WN_MAP_KIND_VOIDP)
#define WN_MAP32_Create(pool)   WN_MAP_Do_Create(Current_Map_Tab, (pool), WN_MAP_KIND_INT32)
#define WN_MAP64_Create(pool)   WN_MAP_Do_Create(Current_Map_Tab, (pool), WN_MAP_KIND_INT64)
#define IPA_WN_MAP_Create(maptab, pool)   WN_MAP_Do_Create((maptab), (pool), WN_MAP_KIND_VOIDP)
#define IPA_WN_MAP32_Create(maptab, pool)   WN_MAP_Do_Create((maptab), (pool), WN_MAP_KIND_INT32)
#define IPA_WN_MAP64_Create(maptab, pool)   WN_MAP_Do_Create((maptab), (pool), WN_MAP_KIND_INT64)
#define WN_MAP_Status()   IPA_WN_MAP_Status(Current_Map_Tab)
#define WN_MAP_Delete(wn_map)   IPA_WN_MAP_Delete(Current_Map_Tab, (wn_map))
#define WN_MAP_Set(wn_map, wn, thing)   IPA_WN_MAP_Set(Current_Map_Tab, (wn_map), (wn), (thing))
#define WN_MAP32_Set(wn_map, wn, thing)   IPA_WN_MAP32_Set(Current_Map_Tab, (wn_map), (wn), (thing))
#define WN_MAP64_Set(wn_map, wn, thing)   IPA_WN_MAP64_Set(Current_Map_Tab, (wn_map), (wn), (thing))
#define WN_MAP_Get(wn_map, wn)   IPA_WN_MAP_Get(Current_Map_Tab, (wn_map), (wn))
#define WN_MAP32_Get(wn_map, wn)   IPA_WN_MAP32_Get(Current_Map_Tab, (wn_map), (wn))
#define WN_MAP64_Get(wn_map, wn)   IPA_WN_MAP64_Get(Current_Map_Tab, (wn_map), (wn))
#define WN_MAP_Size(wn_map, category)   IPA_WN_MAP_Size(Current_Map_Tab, (wn_map), (category))
#define IPA_WN_MAP_Size(maptab, wn_map, category)   (maptab)->_map_size[(category)][(wn_map)]
#define WN_MAP_Get_Kind(wn_map)   (Current_Map_Tab->_kind[(wn_map)])

Typedefs

typedef INT32 WN_MAP
typedef struct wn_map_tab WN_MAP_TAB

Enumerations

enum  WN_MAP_KIND { WN_MAP_KIND_VOIDP = 1, WN_MAP_KIND_INT32 = 2, WN_MAP_KIND_INT64 = 3 }

Functions

WN_MAP_TABWN_MAP_TAB_Create (struct mem_pool *pool)
void WN_MAP_TAB_Delete (WN_MAP_TAB *maptab)
WN_MAP WN_MAP_Do_Create (WN_MAP_TAB *maptab, struct mem_pool *pool, WN_MAP_KIND kind)
WN_MAP_ID IPA_WN_MAP_Status (WN_MAP_TAB *maptab)
void IPA_WN_MAP_Delete (WN_MAP_TAB *maptab, WN_MAP wn_map)
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

Define Documentation

#define IPA_WN_MAP32_Create (   maptab,
  pool 
)    WN_MAP_Do_Create((maptab), (pool), WN_MAP_KIND_INT32)

Definition at line 350 of file wn_map.h.

#define IPA_WN_MAP64_Create (   maptab,
  pool 
)    WN_MAP_Do_Create((maptab), (pool), WN_MAP_KIND_INT64)

Definition at line 352 of file wn_map.h.

#define IPA_WN_MAP_Create (   maptab,
  pool 
)    WN_MAP_Do_Create((maptab), (pool), WN_MAP_KIND_VOIDP)

Definition at line 348 of file wn_map.h.

Referenced by IPO_CLONE::New_Clone().

#define IPA_WN_MAP_Size (   maptab,
  wn_map,
  category 
)    (maptab)->_map_size[(category)][(wn_map)]

Definition at line 424 of file wn_map.h.

Definition at line 343 of file wn_map.h.

Referenced by Anl_Init_Map(), and Write_PU_Info().

#define WN_MAP32_Set (   wn_map,
  wn,
  thing 
)    IPA_WN_MAP32_Set(Current_Map_Tab, (wn_map), (wn), (thing))

Definition at line 345 of file wn_map.h.

#define WN_MAP64_Get (   wn_map,
  wn 
)    IPA_WN_MAP64_Get(Current_Map_Tab, (wn_map), (wn))

Definition at line 418 of file wn_map.h.

Referenced by ir_put_wn(), WN_CopyMap(), and WN_MAP_retrieve().

#define WN_MAP64_Set (   wn_map,
  wn,
  thing 
)    IPA_WN_MAP64_Set(Current_Map_Tab, (wn_map), (wn), (thing))

Definition at line 394 of file wn_map.h.

Referenced by WN_CopyMap(), and WN_MAP_put().

#define WN_MAP_AC_INTERNAL   3

Definition at line 291 of file wn_map.h.

Referenced by ir_b_write_tree(), Read_Local_Info(), and WN_MAP_TAB_Create().

#define WN_MAP_ALIAS_CLASS   4
#define WN_MAP_DEPGRAPH   0

Definition at line 288 of file wn_map.h.

Referenced by WN_MAP_TAB_Create().

#define WN_MAP_Get_Kind (   wn_map)    (Current_Map_Tab->_kind[(wn_map)])

Definition at line 438 of file wn_map.h.

Referenced by ir_put_wn().

#define WN_MAP_RESERVED   5

Definition at line 295 of file wn_map.h.

Referenced by IPA_WN_MAP_Status(), WN_MAP_Do_Create(), and WN_MAP_TAB_Create().

#define WN_MAP_Size (   wn_map,
  category 
)    IPA_WN_MAP_Size(Current_Map_Tab, (wn_map), (category))

Definition at line 422 of file wn_map.h.

Definition at line 359 of file wn_map.h.

#define WN_MAP_TAB_Last_ID (   maptab,
  category 
)    (maptab)->_last_map_id[(category)]

Definition at line 331 of file wn_map.h.

Referenced by fix_tree().


Typedef Documentation

typedef INT32 WN_MAP

Definition at line 281 of file wn_map.h.

typedef struct wn_map_tab WN_MAP_TAB

Enumeration Type Documentation

Enumerator:
WN_MAP_KIND_VOIDP 
WN_MAP_KIND_INT32 
WN_MAP_KIND_INT64 

Definition at line 298 of file wn_map.h.


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_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