14 #ifndef LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H 15 #define LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H 39 class AssumptionCache;
46 class TargetLibraryInfo;
134 assert(Inst &&
"Def requires inst");
138 assert(Inst &&
"Clobber requires inst");
145 return MemDepResult(ValueTy::create<Other>(NonFuncLocal));
157 bool isDef()
const {
return Value.is<Def>(); }
162 return Value.is<Other>() && Value.cast<Other>() == NonLocal;
168 return Value.is<Other>() && Value.cast<Other>() == NonFuncLocal;
174 return Value.is<Other>() && Value.cast<Other>() == Unknown;
180 switch (Value.getTag()) {
182 return Value.cast<Invalid>();
184 return Value.cast<Clobber>();
186 return Value.cast<Def>();
202 bool isDirty()
const {
return Value.is<
Invalid>(); }
218 : BB(bb), Result(result) {}
243 : Entry(bb, result), Address(address) {}
299 struct NonLocalPointerInfo {
313 NonLocalPointerInfo() =
default;
343 using PerInstNLInfo = std::pair<NonLocalDepInfo, bool>;
371 : AA(AA), AC(AC), TLI(TLI), DT(DT), PV(PV) {}
380 unsigned getDefaultBlockScanLimit()
const;
413 void getNonLocalPointerDependency(
Instruction *QueryInst,
427 void invalidateCachedPointerInfo(Value *
Ptr);
433 void invalidateCachedPredecessors();
452 unsigned *Limit =
nullptr);
459 unsigned *Limit =
nullptr);
476 static unsigned getLoadLoadClobberFullWidthSize(
const Value *MemLocBase,
482 void releaseMemory();
488 bool getNonLocalPointerDepFromBB(
Instruction *QueryInst,
494 bool SkipFirstBlock =
false);
498 unsigned NumSortedEntries);
536 void releaseMemory()
override;
546 #endif // LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H
Value * getAddress() const
Returns the address of this pointer in this block.
Provides a lazy, caching interface for making common memory aliasing information queries, backed by LLVM's alias analysis passes.
Compute iterated dominance frontiers using a linear time algorithm.
A compile time pair of an integer tag and the pointer-like type which it indexes within a sum type...
bool operator<(const NonLocalDepEntry &RHS) const
bool isNonLocal() const
Tests if this MemDepResult represents a query that is transparent to the start of the block...
bool operator>(const MemDepResult &M) const
A cache of @llvm.assume calls within a function.
An instruction for reading from memory.
void setResult(const MemDepResult &R, Value *Addr)
bool operator!=(const MemDepResult &M) const
bool isDef() const
Tests if this MemDepResult represents a query that is an instruction definition dependency.
bool isClobber() const
Tests if this MemDepResult represents a query that is an instruction clobber dependency.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
static bool isLoad(int Opcode)
static MemDepResult getDef(Instruction *Inst)
get methods: These are static ctor methods for creating various MemDepResult kinds.
An analysis that produces MemoryDependenceResults for a function.
MemoryDependenceResults(AliasAnalysis &AA, AssumptionCache &AC, const TargetLibraryInfo &TLI, DominatorTree &DT, PhiValues &PV)
PredIteratorCache - This class is an extremely trivial cache for predecessor iterator queries...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
static MemDepResult getUnknown()
static bool runOnFunction(Function &F, bool PostInlining)
A set of analyses that are preserved following a run of a transformation pass.
LLVM Basic Block Representation.
PointerIntPair - This class implements a pair of a pointer and small integer.
PHITransAddr - An address value which tracks and handles phi translation.
This is a result from a NonLocal dependence query.
A CRTP mix-in that provides informational APIs needed for analysis passes.
NonLocalDepResult(BasicBlock *bb, MemDepResult result, Value *address)
Represent the analysis usage information of a pass.
static MemDepResult getNonFuncLocal()
FunctionPass class - This class is used to implement most global optimizations.
bool operator<(const MemDepResult &M) const
void setResult(const MemDepResult &R)
friend class MemoryDependenceResults
A wrapper analysis pass for the legacy pass manager that exposes a MemoryDepnedenceResults instance...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
A memory dependence query can return one of three different answers.
Representation for a specific memory location.
const MemDepResult & getResult() const
NonLocalDepEntry(BasicBlock *bb, MemDepResult result)
Provides information about what library functions are available for the current target.
static MemDepResult getClobber(Instruction *Inst)
const MemDepResult & getResult() const
BasicBlock * getBB() const
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
BasicBlock * getBB() const
InstListType::iterator iterator
Instruction iterators...
bool isNonFuncLocal() const
Tests if this MemDepResult represents a query that is transparent to the start of the function...
std::vector< NonLocalDepEntry > NonLocalDepInfo
A sum type over pointer-like types.
bool isUnknown() const
Tests if this MemDepResult represents a query which cannot and/or will not be computed.
NonLocalDepEntry(BasicBlock *bb)
Instruction * getInst() const
If this is a normal dependency, returns the instruction that is depended on.
This file provides utility analysis objects describing memory locations.
Class for calculating and caching the underlying values of phis in a function.
API to communicate dependencies between analyses during invalidation.
bool operator==(const MemDepResult &M) const
MemoryDependenceResults & getMemDep()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
This is an entry in the NonLocalDepInfo cache.
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.
static MemDepResult getNonLocal()
A special type used by analysis passes to provide an address that identifies that particular analysis...