LLVM  6.0.0svn
Classes | Public Types | Public Member Functions | Friends | List of all members
llvm::AliasSetTracker Class Reference

#include "llvm/Analysis/AliasSetTracker.h"

Public Types

using iterator = ilist< AliasSet >::iterator
 
using const_iterator = ilist< AliasSet >::const_iterator
 

Public Member Functions

 AliasSetTracker (AliasAnalysis &aa)
 Create an empty collection of AliasSets, and use the specified alias analysis object to disambiguate load and store addresses. More...
 
 ~AliasSetTracker ()
 
void add (Value *Ptr, uint64_t Size, const AAMDNodes &AAInfo)
 These methods are used to add different types of instructions to the alias sets. More...
 
void add (LoadInst *LI)
 
void add (StoreInst *SI)
 
void add (VAArgInst *VAAI)
 
void add (MemSetInst *MSI)
 
void add (MemTransferInst *MTI)
 
void add (Instruction *I)
 
void add (BasicBlock &BB)
 
void add (const AliasSetTracker &AST)
 
void addUnknown (Instruction *I)
 
void clear ()
 
const ilist< AliasSet > & getAliasSets () const
 Return the alias sets that are active. More...
 
AliasSetgetAliasSetForPointer (Value *P, uint64_t Size, const AAMDNodes &AAInfo)
 Return the alias set that the specified pointer lives in. More...
 
AliasSetgetAliasSetForPointerIfExists (const Value *P, uint64_t Size, const AAMDNodes &AAInfo)
 Return the alias set containing the location specified if one exists, otherwise return null. More...
 
bool containsUnknown (const Instruction *I) const
 Return true if the specified instruction "may" (or must) alias one of the members in any of the sets. More...
 
AliasAnalysisgetAliasAnalysis () const
 Return the underlying alias analysis object used by this tracker. More...
 
void deleteValue (Value *PtrVal)
 This method is used to remove a pointer value from the AliasSetTracker entirely. More...
 
void copyValue (Value *From, Value *To)
 This method should be used whenever a preexisting value in the program is copied or cloned, introducing a new value. More...
 
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 322 of file AliasSetTracker.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 417 of file AliasSetTracker.h.

◆ iterator

Definition at line 416 of file AliasSetTracker.h.

Constructor & Destructor Documentation

◆ AliasSetTracker()

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

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

Definition at line 352 of file AliasSetTracker.h.

◆ ~AliasSetTracker()

llvm::AliasSetTracker::~AliasSetTracker ( )
inline

Definition at line 353 of file AliasSetTracker.h.

References llvm::ARM_AM::add, clear(), I, and SI.

Member Function Documentation

◆ add() [1/9]

void AliasSetTracker::add ( Value Ptr,
uint64_t  Size,
const AAMDNodes AAInfo 
)

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

Referenced by isIgnorableInst(), llvm::promoteLoopAccessesToScalars(), and sinkLoopInvariantInstructions().

◆ add() [2/9]

void AliasSetTracker::add ( LoadInst LI)

◆ add() [3/9]

void AliasSetTracker::add ( StoreInst SI)

◆ add() [4/9]

void AliasSetTracker::add ( VAArgInst VAAI)

◆ add() [5/9]

void AliasSetTracker::add ( MemSetInst MSI)

◆ add() [6/9]

void AliasSetTracker::add ( MemTransferInst MTI)

◆ add() [7/9]

void AliasSetTracker::add ( Instruction I)

Definition at line 455 of file AliasSetTracker.cpp.

References llvm::ARM_AM::add, and SI.

◆ add() [8/9]

void AliasSetTracker::add ( BasicBlock BB)

Definition at line 470 of file AliasSetTracker.cpp.

References llvm::ARM_AM::add.

◆ add() [9/9]

void AliasSetTracker::add ( const AliasSetTracker AST)

◆ addUnknown()

void AliasSetTracker::addUnknown ( Instruction I)

Definition at line 427 of file AliasSetTracker.cpp.

References llvm::Instruction::mayReadOrWriteMemory().

◆ begin() [1/2]

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

Definition at line 419 of file AliasSetTracker.h.

◆ begin() [2/2]

iterator llvm::AliasSetTracker::begin ( )
inline

Definition at line 422 of file AliasSetTracker.h.

◆ clear()

void AliasSetTracker::clear ( )

◆ containsUnknown()

bool AliasSetTracker::containsUnknown ( const Instruction I) const

Return true if the specified instruction "may" (or must) alias one of the members in any of the sets.

Definition at line 282 of file AliasSetTracker.cpp.

References llvm::AliasSet::aliasesUnknownInst(), llvm::AliasSet::begin(), E, llvm::AliasSet::end(), and llvm::AliasSet::mergeSetIn().

◆ copyValue()

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

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

References AS, assert(), llvm::AliasSet::begin(), E, llvm::AliasSet::end(), P, and SaturationThreshold.

Referenced by dump(), llvm::hoistRegion(), isSafeToExecuteUnconditionally(), and llvm::promoteLoopAccessesToScalars().

◆ deleteValue()

void AliasSetTracker::deleteValue ( Value PtrVal)

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

Referenced by dump(), llvm::hoistRegion(), isSafeToExecuteUnconditionally(), llvm::promoteLoopAccessesToScalars(), sink(), and llvm::sinkRegion().

◆ dump()

LLVM_DUMP_METHOD void AliasSetTracker::dump ( ) const

◆ end() [1/2]

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

Definition at line 420 of file AliasSetTracker.h.

◆ end() [2/2]

iterator llvm::AliasSetTracker::end ( )
inline

Definition at line 423 of file AliasSetTracker.h.

References llvm::AliasSet::dump(), and llvm::AliasSet::print().

◆ getAliasAnalysis()

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

Return the underlying alias analysis object used by this tracker.

Definition at line 402 of file AliasSetTracker.h.

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

◆ getAliasSetForPointer()

AliasSet & AliasSetTracker::getAliasSetForPointer ( Value Pointer,
uint64_t  Size,
const AAMDNodes AAInfo 
)

Return the alias set that the specified pointer lives in.

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

References AS, and assert().

Referenced by pointerInvalidatedByLoop().

◆ getAliasSetForPointerIfExists()

AliasSet* llvm::AliasSetTracker::getAliasSetForPointerIfExists ( const Value P,
uint64_t  Size,
const AAMDNodes AAInfo 
)
inline

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

Definition at line 392 of file AliasSetTracker.h.

◆ getAliasSets()

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

Return the alias sets that are active.

Definition at line 381 of file AliasSetTracker.h.

References P.

◆ print()

void AliasSetTracker::print ( raw_ostream OS) const

Definition at line 643 of file AliasSetTracker.cpp.

References llvm::AliasSet::print().

Referenced by llvm::operator<<().

Friends And Related Function Documentation

◆ AliasSet

friend class AliasSet
friend

Definition at line 429 of file AliasSetTracker.h.


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