Go to the documentation of this file.
13 #ifndef LLVM_ANALYSIS_CAPTURETRACKING_H
14 #define LLVM_ANALYSIS_CAPTURETRACKING_H
28 template <
typename T>
class SmallPtrSetImpl;
46 bool StoreCaptures,
unsigned MaxUsesToExplore = 0);
52 const SmallPtrSetImpl<const Value *> &EphValues,
53 unsigned MaxUsesToExplore = 0);
69 bool StoreCaptures,
const Instruction *
I,
70 const DominatorTree *DT,
71 bool IncludeI =
false,
72 unsigned MaxUsesToExplore = 0,
73 const LoopInfo *LI =
nullptr);
85 bool StoreCaptures,
const DominatorTree &DT,
86 const SmallPtrSetImpl<const Value *> &EphValues,
87 unsigned MaxUsesToExplore = 0);
133 IsDereferenceableOrNull);
142 unsigned MaxUsesToExplore = 0);
148 SmallDenseMap<const Value *, bool, 8> *IsCapturedCache =
nullptr);
This is an optimization pass for GlobalISel generic memory operations.
unsigned getDefaultMaxUsesToExploreForCaptureTracking()
getDefaultMaxUsesToExploreForCaptureTracking - Return default value of the maximal number of uses to ...
A parsed version of the target data layout string in and methods for querying it.
bool isNonEscapingLocalObject(const Value *V, SmallDenseMap< const Value *, bool, 8 > *IsCapturedCache=nullptr)
Returns true if the pointer is to a function-local object that never escapes from the function.
UseCaptureKind
Types of use capture kinds, see DetermineUseCaptureKind.
This callback is used in conjunction with PointerMayBeCaptured.
virtual bool captured(const Use *U)=0
captured - Information about the pointer was captured by the user of use U.
virtual ~CaptureTracker()
virtual bool shouldExplore(const Use *U)
shouldExplore - This is the use of a value derived from the pointer.
virtual bool isDereferenceableOrNull(Value *O, const DataLayout &DL)
isDereferenceableOrNull - Overload to allow clients with additional knowledge about pointer dereferen...
UseCaptureKind DetermineUseCaptureKind(const Use &U, llvm::function_ref< bool(Value *, const DataLayout &)> IsDereferenceableOrNull)
Determine what kind of capture behaviour U may exhibit.
An efficient, type-erasing, non-owning reference to a callable.
Instruction * FindEarliestCapture(const Value *V, Function &F, bool ReturnCaptures, bool StoreCaptures, const DominatorTree &DT, const SmallPtrSetImpl< const Value * > &EphValues, unsigned MaxUsesToExplore=0)
bool PointerMayBeCaptured(const Value *V, bool ReturnCaptures, bool StoreCaptures, unsigned MaxUsesToExplore=0)
PointerMayBeCaptured - Return true if this pointer value may be captured by the enclosing function (w...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
virtual void tooManyUses()=0
tooManyUses - The depth of traversal has breached a limit.
bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures, bool StoreCaptures, const Instruction *I, const DominatorTree *DT, bool IncludeI=false, unsigned MaxUsesToExplore=0, const LoopInfo *LI=nullptr)
PointerMayBeCapturedBefore - Return true if this pointer value may be captured by the enclosing funct...
LLVM Value Representation.
A Use represents the edge between a Value definition and its users.