Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Analysis/ValueTracking.h
Show First 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | class Value; | ||||
/// the intrinsic must preserve the nullness of the pointer. | /// the intrinsic must preserve the nullness of the pointer. | ||||
bool isIntrinsicReturningPointerAliasingArgumentWithoutCapturing( | bool isIntrinsicReturningPointerAliasingArgumentWithoutCapturing( | ||||
const CallBase *Call, bool MustPreserveNullness); | const CallBase *Call, bool MustPreserveNullness); | ||||
/// This method strips off any GEP address adjustments and pointer casts from | /// This method strips off any GEP address adjustments and pointer casts from | ||||
/// the specified value, returning the original object being addressed. Note | /// the specified value, returning the original object being addressed. Note | ||||
/// that the returned value has pointer type if the specified value does. If | /// that the returned value has pointer type if the specified value does. If | ||||
/// the MaxLookup value is non-zero, it limits the number of instructions to | /// the MaxLookup value is non-zero, it limits the number of instructions to | ||||
/// be stripped off. | /// be stripped off. If a NoAlias vector is provided, it is filled with any | ||||
/// llvm.noalias intrinsics looked through to find the underlying object. | |||||
Value *GetUnderlyingObject(Value *V, const DataLayout &DL, | Value *GetUnderlyingObject(Value *V, const DataLayout &DL, | ||||
unsigned MaxLookup = 6); | unsigned MaxLookup = 6, | ||||
inline const Value *GetUnderlyingObject(const Value *V, const DataLayout &DL, | SmallVectorImpl<Instruction *> *NoAlias = nullptr); | ||||
unsigned MaxLookup = 6) { | inline const Value * | ||||
return GetUnderlyingObject(const_cast<Value *>(V), DL, MaxLookup); | GetUnderlyingObject(const Value *V, const DataLayout &DL, | ||||
unsigned MaxLookup = 6, | |||||
SmallVectorImpl<Instruction *> *NoAlias = nullptr) { | |||||
return GetUnderlyingObject(const_cast<Value *>(V), DL, MaxLookup, NoAlias); | |||||
} | } | ||||
/// This method is similar to GetUnderlyingObject except that it can | /// This method is similar to GetUnderlyingObject except that it can | ||||
/// look through phi and select instructions and return multiple objects. | /// look through phi and select instructions and return multiple objects. | ||||
/// | /// | ||||
/// If LoopInfo is passed, loop phis are further analyzed. If a pointer | /// If LoopInfo is passed, loop phis are further analyzed. If a pointer | ||||
/// accesses different objects in each iteration, we don't look through the | /// accesses different objects in each iteration, we don't look through the | ||||
/// phi node. E.g. consider this loop nest: | /// phi node. E.g. consider this loop nest: | ||||
Show All 13 Lines | class Value; | ||||
/// Curr = A[i]; | /// Curr = A[i]; | ||||
/// for (j: 0..N) { | /// for (j: 0..N) { | ||||
/// Curr[j] = Prev[j] * B[j] | /// Curr[j] = Prev[j] * B[j] | ||||
/// } | /// } | ||||
/// } | /// } | ||||
/// | /// | ||||
/// Since A[i] and A[i-1] are independent pointers, getUnderlyingObjects | /// Since A[i] and A[i-1] are independent pointers, getUnderlyingObjects | ||||
/// should not assume that Curr and Prev share the same underlying object thus | /// should not assume that Curr and Prev share the same underlying object thus | ||||
/// it shouldn't look through the phi above. | /// it shouldn't look through the phi above. If a NoAlias vector is provided, | ||||
/// it is filled with any llvm.noalias intrinsics looked through to find the | |||||
/// underlying objects. | |||||
void GetUnderlyingObjects(const Value *V, | void GetUnderlyingObjects(const Value *V, | ||||
SmallVectorImpl<const Value *> &Objects, | SmallVectorImpl<const Value *> &Objects, | ||||
const DataLayout &DL, LoopInfo *LI = nullptr, | const DataLayout &DL, LoopInfo *LI = nullptr, | ||||
unsigned MaxLookup = 6); | unsigned MaxLookup = 6, | ||||
SmallVectorImpl<Instruction *> *NoAlias = nullptr); | |||||
/// This is a wrapper around GetUnderlyingObjects and adds support for basic | /// This is a wrapper around GetUnderlyingObjects and adds support for basic | ||||
/// ptrtoint+arithmetic+inttoptr sequences. | /// ptrtoint+arithmetic+inttoptr sequences. | ||||
bool getUnderlyingObjectsForCodeGen(const Value *V, | bool getUnderlyingObjectsForCodeGen(const Value *V, | ||||
SmallVectorImpl<Value *> &Objects, | SmallVectorImpl<Value *> &Objects, | ||||
const DataLayout &DL); | const DataLayout &DL); | ||||
/// Return true if the only users of this pointer are lifetime markers. | /// Return true if the only users of this pointer are lifetime markers. | ||||
▲ Show 20 Lines • Show All 324 Lines • Show Last 20 Lines |