|
LLVM
3.7.0
|
#include <AliasSetTracker.h>
Public Types | |
| typedef ilist< AliasSet >::iterator | iterator |
| typedef ilist< AliasSet > ::const_iterator | const_iterator |
Public Member Functions | |
| AliasSetTracker (AliasAnalysis &aa) | |
| AliasSetTracker ctor - Create an empty collection of AliasSets, and use the specified alias analysis object to disambiguate load and store addresses. More... | |
| ~AliasSetTracker () | |
| bool | add (Value *Ptr, uint64_t Size, const AAMDNodes &AAInfo) |
| add methods - These methods are used to add different types of instructions to the alias sets. More... | |
| 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 AAMDNodes &AAInfo) |
| remove methods - These methods are used to remove all entries that might be aliased by the specified instruction. More... | |
| bool | remove (LoadInst *LI) |
| bool | remove (StoreInst *SI) |
| bool | remove (VAArgInst *VAAI) |
| bool | remove (Instruction *I) |
| void | remove (AliasSet &AS) |
| remove - Remove the specified (potentially non-empty) alias set from the tracker. More... | |
| bool | removeUnknown (Instruction *I) |
| void | clear () |
| const ilist< AliasSet > & | getAliasSets () const |
| getAliasSets - Return the alias sets that are active. More... | |
| AliasSet & | getAliasSetForPointer (Value *P, uint64_t Size, const AAMDNodes &AAInfo, bool *New=nullptr) |
| getAliasSetForPointer - Return the alias set that the specified pointer lives in. More... | |
| AliasSet * | getAliasSetForPointerIfExists (const Value *P, uint64_t Size, const AAMDNodes &AAInfo) |
| getAliasSetForPointerIfExists - Return the alias set containing the location specified if one exists, otherwise return null. More... | |
| bool | containsPointer (const Value *P, uint64_t Size, const AAMDNodes &AAInfo) const |
| containsPointer - Return true if the specified location is represented by this alias set, false otherwise. 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... | |
| AliasAnalysis & | getAliasAnalysis () const |
| getAliasAnalysis - Return the underlying alias analysis object used by this tracker. More... | |
| void | deleteValue (Value *PtrVal) |
| deleteValue method - This method is used to remove a pointer value from the AliasSetTracker entirely. More... | |
| void | 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. 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 |
Definition at line 286 of file AliasSetTracker.h.
Definition at line 403 of file AliasSetTracker.h.
| typedef ilist<AliasSet>::iterator llvm::AliasSetTracker::iterator |
Definition at line 402 of file AliasSetTracker.h.
|
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 315 of file AliasSetTracker.h.
|
inline |
Definition at line 316 of file AliasSetTracker.h.
References clear().
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:
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 297 of file AliasSetTracker.cpp.
Referenced by add().
Definition at line 304 of file AliasSetTracker.cpp.
References addUnknown(), llvm::Instruction::getAAMetadata(), llvm::User::getOperand(), llvm::LoadInst::getOrdering(), llvm::Value::getType(), llvm::AliasAnalysis::getTypeStoreSize(), llvm::LoadInst::isVolatile(), and llvm::Monotonic.
Definition at line 319 of file AliasSetTracker.cpp.
References addUnknown(), llvm::Instruction::getAAMetadata(), llvm::User::getOperand(), llvm::StoreInst::getOrdering(), llvm::Value::getType(), llvm::AliasAnalysis::getTypeStoreSize(), llvm::StoreInst::isVolatile(), and llvm::Monotonic.
Definition at line 335 of file AliasSetTracker.cpp.
References llvm::Instruction::getAAMetadata(), llvm::User::getOperand(), and llvm::MemoryLocation::UnknownSize.
| bool AliasSetTracker::add | ( | Instruction * | I | ) |
Definition at line 363 of file AliasSetTracker.cpp.
References add(), addUnknown(), and llvm::SI.
| void AliasSetTracker::add | ( | BasicBlock & | BB | ) |
Definition at line 374 of file AliasSetTracker.cpp.
References add(), llvm::BasicBlock::begin(), llvm::BasicBlock::end(), and I.
| void AliasSetTracker::add | ( | const AliasSetTracker & | AST | ) |
Definition at line 379 of file AliasSetTracker.cpp.
References add(), llvm::AliasSet::begin(), begin(), llvm::AliasSet::end(), end(), I, llvm::AliasSet::isVolatile(), and X.
| bool AliasSetTracker::addUnknown | ( | Instruction * | I | ) |
Definition at line 346 of file AliasSetTracker.cpp.
References AliasSet, and llvm::Instruction::mayReadOrWriteMemory().
Referenced by add().
|
inline |
Definition at line 405 of file AliasSetTracker.h.
Referenced by add(), canSinkOrHoistInst(), containsPointer(), containsUnknown(), deleteValue(), and print().
|
inline |
Definition at line 408 of file AliasSetTracker.h.
| void AliasSetTracker::clear | ( | ) |
Definition at line 200 of file AliasSetTracker.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::begin(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), and I.
Referenced by ~AliasSetTracker().
| bool AliasSetTracker::containsPointer | ( | const Value * | Ptr, |
| uint64_t | Size, | ||
| const AAMDNodes & | AAInfo | ||
| ) | 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.
| 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 246 of file AliasSetTracker.cpp.
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 546 of file AliasSetTracker.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find_as().
Referenced by llvm::hoistRegion().
| 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 507 of file AliasSetTracker.cpp.
References begin(), llvm::AliasAnalysis::deleteValue(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find_as(), and llvm::Instruction::mayReadOrWriteMemory().
Referenced by llvm::hoistRegion(), promoteSingleBlockAlloca(), rewriteSingleStoreAlloca(), sink(), and llvm::sinkRegion().
| void AliasSetTracker::dump | ( | ) | const |
Definition at line 613 of file AliasSetTracker.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 406 of file AliasSetTracker.h.
Referenced by add(), canSinkOrHoistInst(), containsPointer(), containsUnknown(), deleteValue(), and print().
|
inline |
Definition at line 409 of file AliasSetTracker.h.
|
inline |
getAliasAnalysis - Return the underlying alias analysis object used by this tracker.
Definition at line 384 of file AliasSetTracker.h.
Referenced by llvm::AliasSet::mergeSetIn().
| AliasSet & AliasSetTracker::getAliasSetForPointer | ( | Value * | Pointer, |
| uint64_t | Size, | ||
| const AAMDNodes & | AAInfo, | ||
| bool * | New = nullptr |
||
| ) |
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 272 of file AliasSetTracker.cpp.
References AliasSet.
Referenced by pointerInvalidatedByLoop().
|
inline |
getAliasSetForPointerIfExists - Return the alias set containing the location specified if one exists, otherwise return null.
Definition at line 367 of file AliasSetTracker.h.
getAliasSets - Return the alias sets that are active.
Definition at line 355 of file AliasSetTracker.h.
| void AliasSetTracker::print | ( | raw_ostream & | OS | ) | const |
Definition at line 603 of file AliasSetTracker.cpp.
References begin(), end(), I, llvm::Value::print(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::size().
Referenced by dump(), and llvm::operator<<().
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 438 of file AliasSetTracker.cpp.
Definition at line 445 of file AliasSetTracker.cpp.
References llvm::Instruction::getAAMetadata(), llvm::User::getOperand(), llvm::Value::getType(), and llvm::AliasAnalysis::getTypeStoreSize().
Definition at line 457 of file AliasSetTracker.cpp.
References llvm::Instruction::getAAMetadata(), llvm::User::getOperand(), llvm::Value::getType(), and llvm::AliasAnalysis::getTypeStoreSize().
Definition at line 469 of file AliasSetTracker.cpp.
References llvm::Instruction::getAAMetadata(), llvm::User::getOperand(), and llvm::MemoryLocation::UnknownSize.
| bool AliasSetTracker::remove | ( | Instruction * | I | ) |
Definition at line 490 of file AliasSetTracker.cpp.
References removeUnknown(), and llvm::SI.
| void AliasSetTracker::remove | ( | AliasSet & | AS | ) |
remove - Remove the specified (potentially non-empty) alias set from the tracker.
Definition at line 408 of file AliasSetTracker.cpp.
References llvm::AliasSet::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), and P.
| bool AliasSetTracker::removeUnknown | ( | Instruction * | I | ) |
Definition at line 480 of file AliasSetTracker.cpp.
References llvm::Instruction::mayReadOrWriteMemory().
Referenced by remove().
|
friend |
Definition at line 415 of file AliasSetTracker.h.
Referenced by addUnknown(), and getAliasSetForPointer().
1.8.6