#include <AliasMap.hpp>


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< LocIterator > | getMayLocs (MemRefHandle ref) |
| iterator over locations that a memory reference may reference | |
| OA_ptr< LocIterator > | getMustLocs (MemRefHandle ref) |
| OA_ptr< LocIterator > | getMayLocs (MemRefExpr &ref, ProcHandle proc) |
| iterator over locations that a memory refer expression may reference | |
| OA_ptr< LocIterator > | getMustLocs (MemRefExpr &ref, ProcHandle proc) |
| iterator over locations that a memory refer expression may reference | |
| OA_ptr< MemRefIterator > | getMustAliases (MemRefHandle ref) |
| get iterator over all must aliases for a specific mem ref | |
| OA_ptr< MemRefIterator > | getMayAliases (MemRefHandle ref) |
| get iterator over all may aliases for a specific mem ref | |
| OA_ptr< MemRefIterator > | getMustAliases (OA_ptr< Location > loc) |
| get iterator over all must aliases for a specific location | |
| OA_ptr< MemRefIterator > | getMayAliases (OA_ptr< Location > loc) |
| get iterator over all may aliases for a specific location | |
| OA_ptr< MemRefIterator > | getMemRefIter () |
| 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< IdIterator > | getIdIterator () |
| get iterator over ids for this alias map | |
| OA_ptr< LocIterator > | getLocIterator (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, MemRefSet > | mIdToMemRefSetMap |
| 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 |
Definition at line 85 of file AliasMap.hpp.
| OA::Alias::AliasMap::AliasMap | ( | ) |
| OA::Alias::AliasMap::AliasMap | ( | ProcHandle | p | ) |
Definition at line 29 of file AliasMap.cpp.
References OA::Alias::debug, OA::Alias::MAYALIAS, mIdToLocSetMap, mIdToSetStatusMap, and OA_DEBUG_CTRL_MACRO.
| OA::Alias::AliasMap::AliasMap | ( | AliasMap & | other | ) |
Copy constructor
Definition at line 45 of file AliasMap.cpp.
References mIdToLocSetMap, mIdToMemRefSetMap, mIdToSetStatusMap, mLocToIdMap, mMemRefToIdMap, mMREToIdMap, mNumSets, mProcHandle, and mStartId.
| OA::Alias::AliasMap::~AliasMap | ( | ) | [inline] |
Definition at line 92 of file AliasMap.hpp.
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().

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

merge all alias map sets that involve the given locations and add a new set if necessary containing these two locations
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().

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

| 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().
get the map from set it to location sets.
Definition at line 848 of file AliasMap.cpp.
References getIdIterator(), and getLocIterator().

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

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

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

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

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

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

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

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

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

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

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

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

| void OA::Alias::AliasMap::output | ( | OA::IRHandlesIRInterface & | ir | ) | [virtual] |
will use OutputBuilder to generate output
Implements OA::Annotation.
Definition at line 13 of file AliasMap_output.cpp.
References OA::LocSetIterator::current(), OA::int2string(), OA::LocSetIterator::isValid(), mIdToLocSetMap, mIdToMemRefSetMap, mIdToMRESetMap, mIdToSetStatusMap, mLocToIdMap, mMemRefToIdMap, mMREToIdMap, mNumSets, mProcHandle, mStartId, OA::OA_ptr< T >::ptrEqual(), and OA::Annotation::sOutBuild.

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

Definition at line 1123 of file AliasMap.cpp.
References OA::LocSetIterator::current(), OA::LocSetIterator::isValid(), and mIdToLocSetMap.

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

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

GENOUT std::map<int,OA_ptr<LocSet> > OA::Alias::AliasMap::mIdToLocSetMap [private] |
Definition at line 254 of file AliasMap.hpp.
Referenced by addLocation(), alias(), aliasLocs(), AliasMap(), getIdIterator(), getLocIterator(), getMapSetId(), getMayAliases(), getMayLocs(), getMustAliases(), getMustLocs(), isPartial(), makeEmptySet(), mapToUnknown(), output(), remapMemRefs(), removeBaseLoc(), and removeInvisibleLocs().
GENOUT std::map<int,MemRefSet> OA::Alias::AliasMap::mIdToMemRefSetMap [private] |
Definition at line 258 of file AliasMap.hpp.
Referenced by AliasMap(), getMayAliases(), getMustAliases(), mapMemRefToMapSet(), output(), and remapMemRefs().
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<int,AliasResultType> OA::Alias::AliasMap::mIdToSetStatusMap [private] |
Definition at line 255 of file AliasMap.hpp.
Referenced by addLocation(), alias(), AliasMap(), getMustAliases(), getMustLocs(), isMust(), makeEmptySet(), mapToUnknown(), 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] |
Definition at line 264 of file AliasMap.hpp.
Referenced by AliasMap(), getMapSetIds(), getMayLocs(), getMemRefIter(), getMustLocs(), mapMemRefToMapSet(), output(), and remapMemRefs().
GENOUT std::map<OA_ptr<MemRefExpr>,int> OA::Alias::AliasMap::mMREToIdMap [private] |
Definition at line 271 of file AliasMap.hpp.
Referenced by AliasMap(), getMapSetId(), getMayLocs(), getMustLocs(), mapMemRefToMapSet(), output(), and remapMemRefs().
GENOUT int OA::Alias::AliasMap::mNumSets [private] |
Definition at line 252 of file AliasMap.hpp.
Referenced by AliasMap(), getNextId(), makeEmptySet(), output(), and remapMemRefs().
OUTPUT GENOUT ProcHandle OA::Alias::AliasMap::mProcHandle [private] |
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] |
Definition at line 94 of file AliasMap.hpp.
Referenced by getMapSetId(), getMapSetIds(), OA::XAIF::ManagerAliasMapXAIF::performAnalysis(), and OA::Alias::ManagerAliasMapBasic::performAnalysis().
1.5.7.1