@@ -45,6 +45,10 @@ template <typename T> class ArrayRef;
4545
4646constexpr unsigned MaxAnalysisRecursionDepth = 6 ;
4747
48+ // / The max limit of the search depth in DecomposeGEPExpression() and
49+ // / getUnderlyingObject().
50+ constexpr unsigned MaxLookupSearchDepth = 6 ;
51+
4852// / Determine which bits of V are known to be either zero or one and return
4953// / them in the KnownZero/KnownOne bit sets.
5054// /
@@ -432,9 +436,10 @@ LLVM_ABI bool isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(
432436// / original object being addressed. Note that the returned value has pointer
433437// / type if the specified value does. If the \p MaxLookup value is non-zero, it
434438// / limits the number of instructions to be stripped off.
435- LLVM_ABI const Value *getUnderlyingObject (const Value *V,
436- unsigned MaxLookup = 6 );
437- inline Value *getUnderlyingObject (Value *V, unsigned MaxLookup = 6 ) {
439+ LLVM_ABI const Value *
440+ getUnderlyingObject (const Value *V, unsigned MaxLookup = MaxLookupSearchDepth);
441+ inline Value *getUnderlyingObject (Value *V,
442+ unsigned MaxLookup = MaxLookupSearchDepth) {
438443 // Force const to avoid infinite recursion.
439444 const Value *VConst = V;
440445 return const_cast <Value *>(getUnderlyingObject (VConst, MaxLookup));
@@ -475,7 +480,7 @@ LLVM_ABI const Value *getUnderlyingObjectAggressive(const Value *V);
475480LLVM_ABI void getUnderlyingObjects (const Value *V,
476481 SmallVectorImpl<const Value *> &Objects,
477482 const LoopInfo *LI = nullptr ,
478- unsigned MaxLookup = 6 );
483+ unsigned MaxLookup = MaxLookupSearchDepth );
479484
480485// / This is a wrapper around getUnderlyingObjects and adds support for basic
481486// / ptrtoint+arithmetic+inttoptr sequences.
0 commit comments