LLVM API Documentation

llvm::AliasSetTracker Class Reference

#include <AliasSetTracker.h>

Collaboration diagram for llvm::AliasSetTracker:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ilist< AliasSet
>::iterator 
iterator
typedef ilist< AliasSet
>::const_iterator 
const_iterator

Public Member Functions

 AliasSetTracker (AliasAnalysis &aa)
bool add (Value *Ptr, unsigned Size)
bool add (LoadInst *LI)
bool add (StoreInst *SI)
bool add (FreeInst *FI)
bool add (CallSite CS)
bool add (CallInst *CI)
bool add (InvokeInst *II)
bool add (Instruction *I)
void add (BasicBlock &BB)
void add (const AliasSetTracker &AST)
bool remove (Value *Ptr, unsigned Size)
bool remove (LoadInst *LI)
bool remove (StoreInst *SI)
bool remove (FreeInst *FI)
bool remove (CallSite CS)
bool remove (CallInst *CI)
bool remove (InvokeInst *II)
bool remove (Instruction *I)
void remove (AliasSet &AS)
void clear ()
const ilist< AliasSet > & getAliasSets () const
AliasSetgetAliasSetForPointer (Value *P, unsigned Size, bool *New=0)
AliasSetgetAliasSetForPointerIfExists (Value *P, unsigned Size)
bool containsPointer (Value *P, unsigned Size) const
AliasAnalysisgetAliasAnalysis () const
void deleteValue (Value *PtrVal)
void copyValue (Value *From, Value *To)
const_iterator begin () const
const_iterator end () const
iterator begin ()
iterator end ()
void print (std::ostream &OS) const
void dump () const

Friends

class AliasSet

Detailed Description

Definition at line 253 of file AliasSetTracker.h.


Member Typedef Documentation

typedef ilist<AliasSet>::iterator llvm::AliasSetTracker::iterator

Definition at line 347 of file AliasSetTracker.h.

typedef ilist<AliasSet>::const_iterator llvm::AliasSetTracker::const_iterator

Definition at line 348 of file AliasSetTracker.h.


Constructor & Destructor Documentation

llvm::AliasSetTracker::AliasSetTracker ( AliasAnalysis aa  )  [inline]

AliasSetTracker ctor - Create an empty collection of AliasSets, and use the specified alias analysis object to disambiguate load and store addresses.

Definition at line 263 of file AliasSetTracker.h.


Member Function Documentation

bool AliasSetTracker::add ( Value Ptr,
unsigned  Size 
)

add methods - These methods are used to add different types of instructions to the alias sets. Adding a new instruction can result in one of three actions happening:

1. If the instruction doesn't alias any other sets, create a new set. 2. If the instruction aliases exactly one set, add it to the set 3. If the instruction aliases multiple sets, merge the sets, and add the instruction to the result.

These methods return true if inserting the instruction resulted in the addition of a new alias set (i.e., the pointer did not alias anything).

Definition at line 261 of file AliasSetTracker.cpp.

Referenced by add().

bool AliasSetTracker::add ( LoadInst LI  ) 

Definition at line 268 of file AliasSetTracker.cpp.

References llvm::AliasAnalysis::getTargetData(), llvm::TargetData::getTypeSize(), LI, and llvm::AliasSet::setVolatile().

bool AliasSetTracker::add ( StoreInst SI  ) 

Definition at line 277 of file AliasSetTracker.cpp.

References llvm::StoreInst::getOperand(), llvm::AliasAnalysis::getTargetData(), llvm::Value::getType(), llvm::TargetData::getTypeSize(), llvm::StoreInst::isVolatile(), llvm::AliasSet::setVolatile(), and Val.

bool AliasSetTracker::add ( FreeInst FI  ) 

Definition at line 287 of file AliasSetTracker.cpp.

References llvm::UnaryInstruction::getOperand(), and llvm::AliasSet::setVolatile().

bool AliasSetTracker::add ( CallSite  CS  ) 

Definition at line 298 of file AliasSetTracker.cpp.

References llvm::AliasSet::addCallSite(), AliasSet, llvm::AliasAnalysis::doesNotAccessMemory(), and llvm::CallSite::getCalledFunction().

bool llvm::AliasSetTracker::add ( CallInst CI  )  [inline]

Definition at line 282 of file AliasSetTracker.h.

References add().

bool llvm::AliasSetTracker::add ( InvokeInst II  )  [inline]

Definition at line 283 of file AliasSetTracker.h.

References add(), and II.

bool AliasSetTracker::add ( Instruction I  ) 

Definition at line 315 of file AliasSetTracker.cpp.

References add(), II, and LI.

void AliasSetTracker::add ( BasicBlock BB  ) 

Definition at line 330 of file AliasSetTracker.cpp.

References add(), BB, llvm::BasicBlock::begin(), E, and llvm::BasicBlock::end().

void AliasSetTracker::add ( const AliasSetTracker AST  ) 

Definition at line 335 of file AliasSetTracker.cpp.

References AA, llvm::AliasSet::AccessTy, add(), AST, llvm::AliasSet::begin(), begin(), llvm::AliasSet::CallSites, E, llvm::AliasSet::end(), end(), llvm::AliasSet::iterator::getPointer(), llvm::AliasSet::iterator::getSize(), and llvm::X.

bool AliasSetTracker::remove ( Value Ptr,
unsigned  Size 
)

remove methods - These methods are used to remove all entries that might be aliased by the specified instruction. These methods return true if any alias sets were eliminated.

Definition at line 386 of file AliasSetTracker.cpp.

Referenced by remove().

bool AliasSetTracker::remove ( LoadInst LI  ) 

Definition at line 393 of file AliasSetTracker.cpp.

References llvm::AliasAnalysis::getTargetData(), llvm::TargetData::getTypeSize(), LI, and remove().

bool AliasSetTracker::remove ( StoreInst SI  ) 

Definition at line 401 of file AliasSetTracker.cpp.

References llvm::StoreInst::getOperand(), llvm::AliasAnalysis::getTargetData(), llvm::Value::getType(), llvm::TargetData::getTypeSize(), and remove().

bool AliasSetTracker::remove ( FreeInst FI  ) 

Definition at line 409 of file AliasSetTracker.cpp.

References llvm::UnaryInstruction::getOperand(), and remove().

bool AliasSetTracker::remove ( CallSite  CS  ) 

Definition at line 416 of file AliasSetTracker.cpp.

References llvm::AliasAnalysis::doesNotAccessMemory(), llvm::CallSite::getCalledFunction(), and remove().

bool llvm::AliasSetTracker::remove ( CallInst CI  )  [inline]

Definition at line 296 of file AliasSetTracker.h.

References remove().

bool llvm::AliasSetTracker::remove ( InvokeInst II  )  [inline]

Definition at line 297 of file AliasSetTracker.h.

References II, and remove().

bool AliasSetTracker::remove ( Instruction I  ) 

Definition at line 427 of file AliasSetTracker.cpp.

References LI, and remove().

void AliasSetTracker::remove ( AliasSet AS  ) 

remove - Remove the specified (potentially non-empty) alias set from the tracker.

Definition at line 361 of file AliasSetTracker.cpp.

References llvm::AliasSet::CallSites, llvm::AliasSet::empty(), llvm::AliasSet::PtrList, llvm::AliasSet::RefCount, and llvm::AliasSet::removeFromTracker().

void llvm::AliasSetTracker::clear (  )  [inline]

Definition at line 301 of file AliasSetTracker.h.

const ilist<AliasSet>& llvm::AliasSetTracker::getAliasSets (  )  const [inline]

getAliasSets - Return the alias sets that are active.

Definition at line 308 of file AliasSetTracker.h.

AliasSet & AliasSetTracker::getAliasSetForPointer ( Value P,
unsigned  Size,
bool *  New = 0 
)

getAliasSetForPointer - Return the alias set that the specified pointer lives in. If the New argument is non-null, this method sets the value to true if a new alias set is created to contain the pointer (because the pointer didn't alias anything).

Definition at line 239 of file AliasSetTracker.cpp.

References llvm::AliasSet::addPointer(), and AliasSet.

AliasSet* llvm::AliasSetTracker::getAliasSetForPointerIfExists ( Value P,
unsigned  Size 
) [inline]

getAliasSetForPointerIfExists - Return the alias set containing the location specified if one exists, otherwise return null.

Definition at line 318 of file AliasSetTracker.h.

bool AliasSetTracker::containsPointer ( Value P,
unsigned  Size 
) const

containsPointer - Return true if the specified location is represented by this alias set, false otherwise. This does not modify the AST object or alias sets.

Definition at line 211 of file AliasSetTracker.cpp.

References begin(), E, and end().

AliasAnalysis& llvm::AliasSetTracker::getAliasAnalysis (  )  const [inline]

getAliasAnalysis - Return the underlying alias analysis object used by this tracker.

Definition at line 329 of file AliasSetTracker.h.

Referenced by llvm::AliasSet::mergeSetIn().

void AliasSetTracker::deleteValue ( Value PtrVal  ) 

deleteValue method - This method is used to remove a pointer value from the AliasSetTracker entirely. It should be used when an instruction is deleted from the program to update the AST. If you don't use this, you would have dangling pointers to deleted instructions.

Definition at line 446 of file AliasSetTracker.cpp.

References llvm::AliasAnalysis::deleteValue(), llvm::AliasAnalysis::doesNotAccessMemory(), llvm::AliasSet::dropRef(), llvm::CallSite::get(), llvm::CallSite::getCalledFunction(), llvm::CallSite::getInstruction(), and llvm::AliasSet::removeCallSite().

void AliasSetTracker::copyValue ( Value From,
Value To 
)

copyValue - This method should be used whenever a preexisting value in the program is copied or cloned, introducing a new value. Note that it is ok for clients that use this method to introduce the same value multiple times: if the tracker already knows about a value, it will ignore the request.

Definition at line 481 of file AliasSetTracker.cpp.

References llvm::AliasSet::addPointer(), and llvm::AliasAnalysis::copyValue().

const_iterator llvm::AliasSetTracker::begin (  )  const [inline]

Definition at line 350 of file AliasSetTracker.h.

Referenced by add(), containsPointer(), and print().

const_iterator llvm::AliasSetTracker::end (  )  const [inline]

Definition at line 351 of file AliasSetTracker.h.

Referenced by add(), containsPointer(), and print().

iterator llvm::AliasSetTracker::begin (  )  [inline]

Definition at line 353 of file AliasSetTracker.h.

iterator llvm::AliasSetTracker::end (  )  [inline]

Definition at line 354 of file AliasSetTracker.h.

void AliasSetTracker::print ( std::ostream &  OS  )  const

Definition at line 537 of file AliasSetTracker.cpp.

References begin(), E, and end().

Referenced by dump(), and llvm::operator<<().

void AliasSetTracker::dump (  )  const

Definition at line 546 of file AliasSetTracker.cpp.

References print().


Friends And Related Function Documentation

friend class AliasSet [friend]

Definition at line 360 of file AliasSetTracker.h.

Referenced by add(), and getAliasSetForPointer().


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