OA::Alias::AliasMap Class Reference

#include <AliasMap.hpp>

Inheritance diagram for OA::Alias::AliasMap:

Inheritance graph
[legend]
Collaboration diagram for OA::Alias::AliasMap:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 AliasMap ()
 AliasMap (ProcHandle p)
 AliasMap (AliasMap &other)
 ~AliasMap ()
AliasResultType alias (MemRefHandle ref1, MemRefHandle ref2)
 indicate the aliasing relationship between two memory references
OA_ptr< LocIteratorgetMayLocs (MemRefHandle ref)
 iterator over locations that a memory reference may reference
OA_ptr< LocIteratorgetMustLocs (MemRefHandle ref)
OA_ptr< LocIteratorgetMayLocs (MemRefExpr &ref, ProcHandle proc)
 iterator over locations that a memory refer expression may reference
OA_ptr< LocIteratorgetMustLocs (MemRefExpr &ref, ProcHandle proc)
 iterator over locations that a memory refer expression may reference
OA_ptr< MemRefIteratorgetMustAliases (MemRefHandle ref)
 get iterator over all must aliases for a specific mem ref
OA_ptr< MemRefIteratorgetMayAliases (MemRefHandle ref)
 get iterator over all may aliases for a specific mem ref
OA_ptr< MemRefIteratorgetMustAliases (OA_ptr< Location > loc)
 get iterator over all must aliases for a specific location
OA_ptr< MemRefIteratorgetMayAliases (OA_ptr< Location > loc)
 get iterator over all may aliases for a specific location
OA_ptr< MemRefIteratorgetMemRefIter ()
OA_ptr< std::set< int > > getMapSetIds (MemRefHandle ref)
int getMapSetId (OA_ptr< MemRefExpr > mre)
int getMapSetId (OA_ptr< OA::Location > pLoc)
int getMapSetId (LocSet pLocSet)
OA_ptr< IdIteratorgetIdIterator ()
 get iterator over ids for this alias map
OA_ptr< LocIteratorgetLocIterator (int setId)
 get iterator over all locations in a particular set
bool isMust (int setId)
 is the equivalence set a must alias equivalence set
int getUnknownLocSetId ()
 set the starting id for the sets
int getNextId ()
int makeEmptySet ()
 create a new alias map set and return the id
void mapMemRefToMapSet (MemRefHandle ref, int setId)
void mapMemRefToMapSet (OA_ptr< MemRefExpr > ref, int setId)
void addLocation (OA_ptr< Location > loc, int setId)
 associate the given location with the given mapSet
OA_ptr< std::map< int, OA_ptr
< LocSet > > > 
getIdToLocSetMap ()
 get the map from set it to location sets.
void aliasLocs (OA_ptr< Location > loc1, OA_ptr< Location > loc2)
void remapMemRefs (int oldSetId, int newSetId)
void mapToUnknown (int setId)
void removeInvisibleLocs (int setId)
 remove all the InvisibleLocs from the specificed set
void removeInvisibleLocs (int setId, OA_ptr< MemRefExpr > inv_memref)
void removeBaseLoc (OA_ptr< Location > baseLoc, int setId)
bool isPartial (int setId, OA_ptr< MemRefExpr > invloc)
void output (IRHandlesIRInterface &pIR)
 will use OutputBuilder to generate output
void dump (std::ostream &os, OA_ptr< OA::IRHandlesIRInterface > ir)

Static Public Attributes

static const int SET_ID_NONE = -1

Private Attributes

OUTPUT GENOUT ProcHandle mProcHandle
GENOUT int mNumSets
GENOUT int mStartId
GENOUT std::map< int, OA_ptr
< LocSet > > 
mIdToLocSetMap
GENOUT std::map< int,
AliasResultType
mIdToSetStatusMap
GENOUT std::map< int, MemRefSetmIdToMemRefSetMap
GENOUT std::map< int,
MemRefExprSet
mIdToMRESetMap
GENOUT std::map< MemRefHandle,
std::set< int > > 
mMemRefToIdMap
GENOUT std::map< OA_ptr
< MemRefExpr >, int > 
mMREToIdMap
GENOUT std::map< OA_ptr
< Location >, int > 
mLocToIdMap


Detailed Description

Satisfies the Alias::Interface and Annotation interface.

Definition at line 85 of file AliasMap.hpp.


Constructor & Destructor Documentation

OA::Alias::AliasMap::AliasMap (  ) 

Definition at line 25 of file AliasMap.cpp.

References OA::Alias::debug, and OA_DEBUG_CTRL_MACRO.

OA::Alias::AliasMap::AliasMap ( ProcHandle  p  ) 

OA::Alias::AliasMap::AliasMap ( AliasMap other  ) 

OA::Alias::AliasMap::~AliasMap (  )  [inline]

Definition at line 92 of file AliasMap.hpp.


Member Function Documentation

void OA::Alias::AliasMap::addLocation ( OA_ptr< Location loc,
int  setId 
)

associate the given location with the given mapSet

add the given location to the set of possible locations for the given alias map set

Definition at line 764 of file AliasMap.cpp.

References OA::OA_ptr< T >::convert(), OA::Alias::debug, OA::OA_ptr< T >::dump(), OA::Alias::MAYALIAS, mIdToLocSetMap, mIdToSetStatusMap, mLocToIdMap, and OA::Alias::MUSTALIAS.

Referenced by aliasLocs().

Here is the call graph for this function:

AliasResultType OA::Alias::AliasMap::alias ( MemRefHandle  ref1,
MemRefHandle  ref2 
) [virtual]

indicate the aliasing relationship between two memory references

Indicate the aliasing relationship between two memory references

It is possible for memory references that map to different alias map sets to must or may alias each other. They will must alias each other if the associated location sets contain only one full location and that location must overlap. They will may alias each other if any of the locations in the associated sets may overlap.

Implements OA::Alias::Interface.

Definition at line 70 of file AliasMap.cpp.

References getMapSetIds(), isMust(), OA::Alias::MAYALIAS, OA::mayOverlapLocSets(), mIdToLocSetMap, mIdToSetStatusMap, OA::Alias::MUSTALIAS, and OA::Alias::NOALIAS.

Here is the call graph for this function:

void OA::Alias::AliasMap::aliasLocs ( OA_ptr< Location loc1,
OA_ptr< Location loc2 
)

merge all alias map sets that involve the given locations and add a new set if necessary containing these two locations

  • find all existing alias map sets that involve the two locations
  • create new alias map set that includes all locations from those sets
  • map all mre's and memrefhandles from old sets to new set
  • remove old alias map sets

FIXME?: right now this implements transitivity of aliasing for the aliases in any sets with loc1 and loc2

Definition at line 876 of file AliasMap.cpp.

References addLocation(), getIdIterator(), getLocIterator(), makeEmptySet(), mIdToLocSetMap, and remapMemRefs().

Here is the call graph for this function:

void OA::Alias::AliasMap::dump ( std::ostream &  os,
OA_ptr< OA::IRHandlesIRInterface ir 
)

incomplete output of info for debugging, just lists map set Ids and associated set of locations and mapping of memrefs to the map set Ids

incomplete output of info for debugging may also include non-persistent handle values

Definition at line 1168 of file AliasMap.cpp.

References OA::OA_ptr< T >::dump(), getIdIterator(), getLocIterator(), getMapSetIds(), getMemRefIter(), and OA::IRHandle::hval().

Here is the call graph for this function:

OA_ptr< IdIterator > OA::Alias::AliasMap::getIdIterator (  ) 

get iterator over ids for this alias map

Definition at line 718 of file AliasMap.cpp.

References mIdToLocSetMap.

Referenced by aliasLocs(), dump(), and getIdToLocSetMap().

OA_ptr< std::map< int, OA_ptr< LocSet > > > OA::Alias::AliasMap::getIdToLocSetMap (  ) 

get the map from set it to location sets.

Definition at line 848 of file AliasMap.cpp.

References getIdIterator(), and getLocIterator().

Here is the call graph for this function:

OA_ptr< LocIterator > OA::Alias::AliasMap::getLocIterator ( int  setId  ) 

get iterator over all locations in a particular set

look up location associated with a symbol returns NULL if one isn't found

Definition at line 163 of file AliasMap.cpp.

References mIdToLocSetMap.

Referenced by aliasLocs(), dump(), and getIdToLocSetMap().

int OA::Alias::AliasMap::getMapSetId ( LocSet  pLocSet  ) 

get id for an alias map set that contains an equivalent set of locations, SET_ID_NONE indicates that no equivalent location set was found in any AliasMap sets

get id for an alias map set that contains an equivalent set of locations, SET_ID_NONE indicates that no equivalent location set was found in any AliasMap sets

Definition at line 698 of file AliasMap.cpp.

References mIdToLocSetMap, SET_ID_NONE, and OA::subSetOf().

Here is the call graph for this function:

int OA::Alias::AliasMap::getMapSetId ( OA_ptr< OA::Location pLoc  ) 

get id for an alias map set that contains the given location, SET_ID_NONE indicates that the given location isn't in any AliasMap sets

get id for an alias map set that contains the given location, SET_ID_NONE indicates that the given location isn't in any AliasMap sets

If more than one map set contains this location, will return the set with the fewest number of other locations because that is what is maintained in the mapping of locations to sets

Definition at line 676 of file AliasMap.cpp.

References mLocToIdMap, and SET_ID_NONE.

int OA::Alias::AliasMap::getMapSetId ( OA_ptr< MemRefExpr mre  ) 

get unique id for the alias map set for this memory reference expression or an equivalent memory reference expression SET_ID_NONE indicates that this memory reference expression doesn't map to any of the existing AliasMap sets

get unique id for the alias map set for this memory reference expression or an equivalent memory reference expression will create a new map set if this memory reference involves a full named location that doesn't have its address taken. SET_ID_NONE indicates that this memory reference expression doesn't map to any of the existing AliasMap sets

Definition at line 653 of file AliasMap.cpp.

References mMREToIdMap, and SET_ID_NONE.

OA_ptr< std::set< int > > OA::Alias::AliasMap::getMapSetIds ( MemRefHandle  ref  ) 

get ids for the alias map set for this memory reference SET_ID_NONE indicates that this memory reference doesn't map to any of the existing AliasMap sets

Read through AliasMap sets in each, alias all locations that are within one alias map set in the returned AliasMap set.

Mostly copying over mappings so start with a copy of ourselves. Then, add any mappings from other that aren't already in retval. get ids for the alias map set for this memory reference, SET_ID_NONE indicates that this memory reference doesn't map to any of the existing AliasMap sets

Definition at line 627 of file AliasMap.cpp.

References mMemRefToIdMap, and SET_ID_NONE.

Referenced by alias(), dump(), getMayAliases(), and getMustAliases().

OA_ptr< MemRefIterator > OA::Alias::AliasMap::getMayAliases ( OA_ptr< Location loc  ) 

get iterator over all may aliases for a specific location

Definition at line 504 of file AliasMap.cpp.

References OA::mayOverlapLocSets(), mIdToLocSetMap, and mIdToMemRefSetMap.

Here is the call graph for this function:

OA_ptr< MemRefIterator > OA::Alias::AliasMap::getMayAliases ( MemRefHandle  ref  ) 

get iterator over all may aliases for a specific mem ref

Definition at line 388 of file AliasMap.cpp.

References OA::Alias::debug, getMapSetIds(), OA::mayOverlapLocSets(), mIdToLocSetMap, and mIdToMemRefSetMap.

Here is the call graph for this function:

OA_ptr< LocIterator > OA::Alias::AliasMap::getMayLocs ( MemRefExpr ref,
ProcHandle  proc 
) [virtual]

iterator over locations that a memory refer expression may reference

Implements OA::Alias::Interface.

Definition at line 244 of file AliasMap.cpp.

References OA::MemRefExpr::clone(), OA::OA_ptr< T >::convert(), mIdToLocSetMap, mMREToIdMap, OA::unionLocSets(), and OA::MemRefExpr::USE.

Here is the call graph for this function:

OA_ptr< LocIterator > OA::Alias::AliasMap::getMayLocs ( MemRefHandle  ref  )  [virtual]

iterator over locations that a memory reference may reference

Implements OA::Alias::Interface.

Definition at line 175 of file AliasMap.cpp.

References mIdToLocSetMap, mMemRefToIdMap, and OA::unionLocSets().

Here is the call graph for this function:

OA_ptr< MemRefIterator > OA::Alias::AliasMap::getMemRefIter (  )  [virtual]

get iterator over all memory references that information is available for

get iterator over all memory references that information is available for

Implements OA::Alias::Interface.

Definition at line 548 of file AliasMap.cpp.

References mMemRefToIdMap.

Referenced by dump().

OA_ptr< MemRefIterator > OA::Alias::AliasMap::getMustAliases ( OA_ptr< Location loc  ) 

get iterator over all must aliases for a specific location

Definition at line 445 of file AliasMap.cpp.

References OA::mayOverlapLocSets(), mIdToLocSetMap, mIdToMemRefSetMap, mIdToSetStatusMap, and OA::Alias::MUSTALIAS.

Here is the call graph for this function:

OA_ptr< MemRefIterator > OA::Alias::AliasMap::getMustAliases ( MemRefHandle  ref  ) 

get iterator over all must aliases for a specific mem ref

Definition at line 327 of file AliasMap.cpp.

References OA::Alias::debug, getMapSetIds(), OA::mayOverlapLocSets(), mIdToLocSetMap, mIdToMemRefSetMap, mIdToSetStatusMap, and OA::Alias::MUSTALIAS.

Here is the call graph for this function:

OA_ptr< LocIterator > OA::Alias::AliasMap::getMustLocs ( MemRefExpr ref,
ProcHandle  proc 
) [virtual]

iterator over locations that a memory refer expression may reference

Implements OA::Alias::Interface.

Definition at line 305 of file AliasMap.cpp.

References OA::MemRefExpr::clone(), mIdToLocSetMap, mIdToSetStatusMap, mMREToIdMap, OA::Alias::MUSTALIAS, and OA::unionLocSets().

Here is the call graph for this function:

OA_ptr< LocIterator > OA::Alias::AliasMap::getMustLocs ( MemRefHandle  ref  )  [virtual]

iterator over locations that a memory reference must reference these locations will all have full static overlap

iterator over locations that a memory reference must reference these locations will all have full static overlap

Implements OA::Alias::Interface.

Definition at line 219 of file AliasMap.cpp.

References mIdToLocSetMap, mIdToSetStatusMap, mMemRefToIdMap, OA::Alias::MUSTALIAS, and OA::unionLocSets().

Here is the call graph for this function:

int OA::Alias::AliasMap::getNextId (  )  [inline]

get the next id that this guy will use if it needs to make another map set

Definition at line 189 of file AliasMap.hpp.

References mNumSets, and mStartId.

int OA::Alias::AliasMap::getUnknownLocSetId (  )  [inline]

set the starting id for the sets

get the id of the unknownLoc set (see the constructor).

Definition at line 185 of file AliasMap.hpp.

bool OA::Alias::AliasMap::isMust ( int  setId  )  [inline]

is the equivalence set a must alias equivalence set

Definition at line 174 of file AliasMap.hpp.

References mIdToSetStatusMap, and OA::Alias::MUSTALIAS.

Referenced by alias().

bool OA::Alias::AliasMap::isPartial ( int  setId,
OA_ptr< MemRefExpr inv_memref 
)

for location with fullAccuracy, check if there exists another location with partial Accuracy in the mIdToLocSetMap.

Definition at line 1145 of file AliasMap.cpp.

References OA::OA_ptr< T >::convert(), OA::LocSetIterator::current(), OA::LocSetIterator::isValid(), and mIdToLocSetMap.

Here is the call graph for this function:

int OA::Alias::AliasMap::makeEmptySet (  ) 

create a new alias map set and return the id

create an empty alias map set and return the id

Definition at line 742 of file AliasMap.cpp.

References mIdToLocSetMap, mIdToSetStatusMap, mNumSets, mStartId, and OA::Alias::MUSTALIAS.

Referenced by aliasLocs().

void OA::Alias::AliasMap::mapMemRefToMapSet ( OA_ptr< MemRefExpr ref,
int  setId 
)

associate a MemRefExpr with the given mapSet, means that the MemRefExpr can access all of the locations in the mapSet, if only one full location then is a must access

associate a MemRefExpr with the given mapSet, means that the MemRefExpr may access all of the locations in the mapSet

Definition at line 1044 of file AliasMap.cpp.

References mIdToMRESetMap, mMREToIdMap, and OA::OA_ptr< T >::ptrEqual().

Here is the call graph for this function:

void OA::Alias::AliasMap::mapMemRefToMapSet ( MemRefHandle  ref,
int  setId 
)

associate a MemRefHandle with the given mapSet, means that the MemRefHandle can access all of the locations in the mapSet

associate a MemRefHandle with the given mapset, means that the MemRefHandle can access all of the locations in the mapset, if only one full location then is a must access

Definition at line 1035 of file AliasMap.cpp.

References mIdToMemRefSetMap, and mMemRefToIdMap.

void OA::Alias::AliasMap::mapToUnknown ( int  setId  ) 

assign the UnknownLoc to the given alias map set and remove all other locations from this set.

assign the UnknownLoc to the given alias map set and remove all other locations from this set.

Definition at line 1010 of file AliasMap.cpp.

References OA::LocSetIterator::current(), OA::LocSetIterator::isValid(), OA::Alias::MAYALIAS, mIdToLocSetMap, mIdToSetStatusMap, and mLocToIdMap.

Here is the call graph for this function:

void OA::Alias::AliasMap::output ( OA::IRHandlesIRInterface ir  )  [virtual]

void OA::Alias::AliasMap::remapMemRefs ( int  oldSetId,
int  newSetId 
)

remap all memrefhandles and memrefexprs to the new set and remove the oldSet

Remaps all memrefhandles and memrefexprs to the new set and removes the oldSet.

Will replace removed set with last set to maintain contiguity.

Definition at line 931 of file AliasMap.cpp.

References OA::LocSetIterator::current(), OA::LocSetIterator::isValid(), mIdToLocSetMap, mIdToMemRefSetMap, mIdToMRESetMap, mIdToSetStatusMap, mLocToIdMap, mMemRefToIdMap, mMREToIdMap, mNumSets, and mStartId.

Referenced by aliasLocs().

Here is the call graph for this function:

void OA::Alias::AliasMap::removeBaseLoc ( OA_ptr< Location baseLoc,
int  setId 
)

Definition at line 1123 of file AliasMap.cpp.

References OA::LocSetIterator::current(), OA::LocSetIterator::isValid(), and mIdToLocSetMap.

Here is the call graph for this function:

void OA::Alias::AliasMap::removeInvisibleLocs ( int  setId,
OA_ptr< MemRefExpr inv_memref 
)

remove the specific Inv MREs are compared.

Definition at line 1081 of file AliasMap.cpp.

References OA::OA_ptr< T >::convert(), OA::LocSetIterator::current(), OA::Alias::debug, OA::OA_ptr< T >::dump(), OA::LocSetIterator::isValid(), and mIdToLocSetMap.

Here is the call graph for this function:

void OA::Alias::AliasMap::removeInvisibleLocs ( int  setId  ) 

remove all the InvisibleLocs from the specificed set

Definition at line 1053 of file AliasMap.cpp.

References OA::LocSetIterator::current(), OA::LocSetIterator::isValid(), and mIdToLocSetMap.

Here is the call graph for this function:


Member Data Documentation

GENOUT std::map<int,OA_ptr<LocSet> > OA::Alias::AliasMap::mIdToLocSetMap [private]

GENOUT std::map<int,MemRefSet> OA::Alias::AliasMap::mIdToMemRefSetMap [private]

GENOUT std::map<int,MemRefExprSet> OA::Alias::AliasMap::mIdToMRESetMap [private]

Definition at line 261 of file AliasMap.hpp.

Referenced by mapMemRefToMapSet(), output(), and remapMemRefs().

GENOUT std::map<OA_ptr<Location>,int> OA::Alias::AliasMap::mLocToIdMap [private]

Definition at line 274 of file AliasMap.hpp.

Referenced by addLocation(), AliasMap(), getMapSetId(), mapToUnknown(), output(), and remapMemRefs().

GENOUT std::map<MemRefHandle,std::set<int> > OA::Alias::AliasMap::mMemRefToIdMap [private]

GENOUT std::map<OA_ptr<MemRefExpr>,int> OA::Alias::AliasMap::mMREToIdMap [private]

GENOUT int OA::Alias::AliasMap::mNumSets [private]

Definition at line 252 of file AliasMap.hpp.

Referenced by AliasMap(), getNextId(), makeEmptySet(), output(), and remapMemRefs().

Definition at line 249 of file AliasMap.hpp.

Referenced by AliasMap(), and output().

GENOUT int OA::Alias::AliasMap::mStartId [private]

Definition at line 253 of file AliasMap.hpp.

Referenced by AliasMap(), getNextId(), makeEmptySet(), output(), and remapMemRefs().

const int OA::Alias::AliasMap::SET_ID_NONE = -1 [static]


The documentation for this class was generated from the following files:

Generated on Fri Jul 24 05:37:55 2009 for OpenADFortTk (extended to Open64) by  doxygen 1.5.7.1