LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
llvm::AliasSetTracker Class Reference

#include <AliasSetTracker.h>

Public Types

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

Public Member Functions

 AliasSetTracker (AliasAnalysis &aa)
 
 ~AliasSetTracker ()
 
bool add (Value *Ptr, uint64_t Size, const MDNode *TBAAInfo)
 
bool add (LoadInst *LI)
 
bool add (StoreInst *SI)
 
bool add (VAArgInst *VAAI)
 
bool add (Instruction *I)
 
void add (BasicBlock &BB)
 
void add (const AliasSetTracker &AST)
 
bool addUnknown (Instruction *I)
 
bool remove (Value *Ptr, uint64_t Size, const MDNode *TBAAInfo)
 
bool remove (LoadInst *LI)
 
bool remove (StoreInst *SI)
 
bool remove (VAArgInst *VAAI)
 
bool remove (Instruction *I)
 
void remove (AliasSet &AS)
 
bool removeUnknown (Instruction *I)
 
void clear ()
 
const ilist< AliasSet > & getAliasSets () const
 
AliasSetgetAliasSetForPointer (Value *P, uint64_t Size, const MDNode *TBAAInfo, bool *New=0)
 
AliasSetgetAliasSetForPointerIfExists (Value *P, uint64_t Size, const MDNode *TBAAInfo)
 
bool containsPointer (Value *P, uint64_t Size, const MDNode *TBAAInfo) 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 (raw_ostream &OS) const
 
void dump () const
 

Friends

class AliasSet
 

Detailed Description

Definition at line 280 of file AliasSetTracker.h.

Member Typedef Documentation

Definition at line 392 of file AliasSetTracker.h.

Definition at line 391 of file AliasSetTracker.h.

Constructor & Destructor Documentation

llvm::AliasSetTracker::AliasSetTracker ( AliasAnalysis aa)
inlineexplicit

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

Definition at line 309 of file AliasSetTracker.h.

llvm::AliasSetTracker::~AliasSetTracker ( )
inline

Definition at line 310 of file AliasSetTracker.h.

References clear().

Member Function Documentation

bool AliasSetTracker::add ( Value Ptr,
uint64_t  Size,
const MDNode TBAAInfo 
)

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 292 of file AliasSetTracker.cpp.

Referenced by add().

bool AliasSetTracker::add ( LoadInst LI)
bool AliasSetTracker::add ( StoreInst SI)
bool AliasSetTracker::add ( VAArgInst VAAI)
bool AliasSetTracker::add ( Instruction I)

Definition at line 350 of file AliasSetTracker.cpp.

References add(), addUnknown(), and LI.

void AliasSetTracker::add ( BasicBlock BB)

Definition at line 361 of file AliasSetTracker.cpp.

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

void AliasSetTracker::add ( const AliasSetTracker AST)
bool AliasSetTracker::addUnknown ( Instruction I)

Definition at line 333 of file AliasSetTracker.cpp.

References AliasSet, and llvm::Instruction::mayReadOrWriteMemory().

Referenced by add().

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

Definition at line 394 of file AliasSetTracker.h.

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

iterator llvm::AliasSetTracker::begin ( )
inline

Definition at line 397 of file AliasSetTracker.h.

void AliasSetTracker::clear ( )
bool AliasSetTracker::containsPointer ( Value Ptr,
uint64_t  Size,
const MDNode TBAAInfo 
) 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 238 of file AliasSetTracker.cpp.

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

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 523 of file AliasSetTracker.cpp.

References llvm::AliasAnalysis::copyValue(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find_as().

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 484 of file AliasSetTracker.cpp.

References begin(), llvm::AliasAnalysis::deleteValue(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find_as(), I, and llvm::Instruction::mayReadOrWriteMemory().

Referenced by promoteSingleBlockAlloca(), and rewriteSingleStoreAlloca().

void AliasSetTracker::dump ( ) const

Definition at line 593 of file AliasSetTracker.cpp.

References llvm::dbgs(), and print().

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

Definition at line 395 of file AliasSetTracker.h.

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

iterator llvm::AliasSetTracker::end ( )
inline

Definition at line 398 of file AliasSetTracker.h.

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

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

Definition at line 373 of file AliasSetTracker.h.

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

AliasSet & AliasSetTracker::getAliasSetForPointer ( Value Pointer,
uint64_t  Size,
const MDNode TBAAInfo,
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).

getAliasSetForPointer - Return the alias set that the specified pointer lives in.

Definition at line 267 of file AliasSetTracker.cpp.

References AliasSet.

AliasSet* llvm::AliasSetTracker::getAliasSetForPointerIfExists ( Value P,
uint64_t  Size,
const MDNode TBAAInfo 
)
inline

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

Definition at line 361 of file AliasSetTracker.h.

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

getAliasSets - Return the alias sets that are active.

Definition at line 349 of file AliasSetTracker.h.

void AliasSetTracker::print ( raw_ostream OS) const
bool AliasSetTracker::remove ( Value Ptr,
uint64_t  Size,
const MDNode TBAAInfo 
)

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 423 of file AliasSetTracker.cpp.

bool AliasSetTracker::remove ( LoadInst LI)
bool AliasSetTracker::remove ( StoreInst SI)
bool AliasSetTracker::remove ( VAArgInst VAAI)
bool AliasSetTracker::remove ( Instruction I)

Definition at line 467 of file AliasSetTracker.cpp.

References LI, and removeUnknown().

void AliasSetTracker::remove ( AliasSet AS)

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

Definition at line 395 of file AliasSetTracker.cpp.

References llvm::AliasSet::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), and P.

bool AliasSetTracker::removeUnknown ( Instruction I)

Definition at line 457 of file AliasSetTracker.cpp.

References llvm::Instruction::mayReadOrWriteMemory().

Referenced by remove().

Friends And Related Function Documentation

friend class AliasSet
friend

Definition at line 404 of file AliasSetTracker.h.

Referenced by addUnknown(), and getAliasSetForPointer().


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