18#ifndef LLVM_ANALYSIS_ALIASSETTRACKER_H
19#define LLVM_ANALYSIS_ALIASSETTRACKER_H
36class AnyMemTransferInst;
58 std::vector<AssertingVH<Instruction>> UnknownInsts;
62 unsigned RefCount : 27;
66 unsigned AliasAny : 1;
78 ModRefAccess = RefAccess | ModAccess
89 SetMustAlias = 0, SetMayAlias = 1
93 void addRef() { ++RefCount; }
96 assert(RefCount >= 1 &&
"Invalid reference count detected!");
98 removeFromTracker(AST);
106 bool isRef()
const {
return Access & RefAccess; }
107 bool isMod()
const {
return Access & ModAccess; }
124 unsigned size()
const {
return MemoryLocs.
size(); }
138 : RefCount(0), AliasAny(
false), Access(NoAccess), Alias(SetMustAlias) {}
143 bool KnownMustAlias =
false);
227 unsigned TotalAliasSetSize = 0;
241 void collapseForwardingIn(
AliasSet *&AS) {
243 collapseForwardingIn(AS->Forward);
252 AliasSet &addMemoryLocation(MemoryLocation Loc, AliasSet::AccessLattice
E);
253 AliasSet *mergeAliasSetsForMemoryLocation(
const MemoryLocation &MemLoc,
261 AliasSet *findAliasSetForUnknownInst(Instruction *Inst);
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the DenseMap class.
This file provides utility analysis objects describing memory locations.
This header defines various interfaces for pass management in LLVM.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
The possible results of an alias query.
ilist< AliasSet >::iterator iterator
const ilist< AliasSet > & getAliasSets() const
Return the alias sets that are active.
BatchAAResults & getAliasAnalysis() const
Return the underlying alias analysis object used by this tracker.
AliasSet & getAliasSetFor(const MemoryLocation &MemLoc)
Return the alias set which contains the specified memory location.
void addUnknown(Instruction *I)
AliasSetTracker(BatchAAResults &AA)
Create an empty collection of AliasSets, and use the specified alias analysis object to disambiguate ...
const_iterator end() const
ilist< AliasSet >::const_iterator const_iterator
const_iterator begin() const
void print(raw_ostream &OS) const
void add(const MemoryLocation &Loc)
These methods are used to add different types of instructions to the alias sets.
void mergeSetIn(AliasSet &AS, AliasSetTracker &AST, BatchAAResults &BatchAA)
Merge the specified alias set into this alias set.
void print(raw_ostream &OS) const
AliasSet(const AliasSet &)=delete
bool isForwardingAliasSet() const
Return true if this alias set should be ignored as part of the AliasSetTracker object.
AliasSet & operator=(const AliasSet &)=delete
ModRefInfo aliasesUnknownInst(const Instruction *Inst, BatchAAResults &AA) const
AliasResult aliasesMemoryLocation(const MemoryLocation &MemLoc, BatchAAResults &AA) const
If the specified memory location "may" (or must) alias one of the members in the set return the appro...
friend class AliasSetTracker
SmallVectorImpl< MemoryLocation >::const_iterator iterator
bool isRef() const
Accessors...
PointerVector getPointers() const
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
A container for analyses that lazily runs them and caches their results.
This class represents any memset intrinsic.
LLVM Basic Block Representation.
This class is a wrapper over an AAResults, and it is intended to be used only when there are no IR ch...
An instruction for reading from memory.
Representation for a specific memory location.
A set of analyses that are preserved following a run of a transformation pass.
typename SuperClass::const_iterator const_iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An instruction for storing to memory.
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
base_list_type::const_iterator const_iterator
base_list_type::iterator iterator
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
This class implements an extremely fast bulk output stream that can only output to a stream.
This file defines classes to implement an intrusive doubly linked list class (i.e.
This file defines the ilist_node class template, which is a convenient base class for creating classe...
@ BasicBlock
Various leaf nodes.
This is an optimization pass for GlobalISel generic memory operations.
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
A CRTP mix-in to automatically provide informational APIs needed for passes.