@@ -54,36 +54,37 @@ constexpr unsigned MaxAnalysisRecursionDepth = 6;
5454// / same width as the vector element, and the bit is set only if it is true
5555// / for all of the elements in the vector.
5656LLVM_ABI void computeKnownBits (const Value *V, KnownBits &Known,
57- const DataLayout &DL, unsigned Depth = 0 ,
57+ const DataLayout &DL,
5858 AssumptionCache *AC = nullptr ,
5959 const Instruction *CxtI = nullptr ,
6060 const DominatorTree *DT = nullptr ,
61- bool UseInstrInfo = true );
61+ bool UseInstrInfo = true , unsigned Depth = 0 );
6262
6363// / Returns the known bits rather than passing by reference.
6464LLVM_ABI KnownBits computeKnownBits (const Value *V, const DataLayout &DL,
65- unsigned Depth = 0 ,
6665 AssumptionCache *AC = nullptr ,
6766 const Instruction *CxtI = nullptr ,
6867 const DominatorTree *DT = nullptr ,
69- bool UseInstrInfo = true );
68+ bool UseInstrInfo = true ,
69+ unsigned Depth = 0 );
7070
7171// / Returns the known bits rather than passing by reference.
7272LLVM_ABI KnownBits computeKnownBits (const Value *V, const APInt &DemandedElts,
73- const DataLayout &DL, unsigned Depth = 0 ,
73+ const DataLayout &DL,
7474 AssumptionCache *AC = nullptr ,
7575 const Instruction *CxtI = nullptr ,
7676 const DominatorTree *DT = nullptr ,
77- bool UseInstrInfo = true );
77+ bool UseInstrInfo = true ,
78+ unsigned Depth = 0 );
7879
7980LLVM_ABI KnownBits computeKnownBits (const Value *V, const APInt &DemandedElts,
80- unsigned Depth, const SimplifyQuery &Q);
81+ const SimplifyQuery &Q, unsigned Depth = 0 );
8182
82- LLVM_ABI KnownBits computeKnownBits (const Value *V, unsigned Depth ,
83- const SimplifyQuery &Q );
83+ LLVM_ABI KnownBits computeKnownBits (const Value *V, const SimplifyQuery &Q ,
84+ unsigned Depth = 0 );
8485
85- LLVM_ABI void computeKnownBits (const Value *V, KnownBits &Known, unsigned Depth,
86- const SimplifyQuery &Q);
86+ LLVM_ABI void computeKnownBits (const Value *V, KnownBits &Known,
87+ const SimplifyQuery &Q, unsigned Depth = 0 );
8788
8889// / Compute known bits from the range metadata.
8990// / \p KnownZero the set of bits that are known to be zero
@@ -93,22 +94,22 @@ LLVM_ABI void computeKnownBitsFromRangeMetadata(const MDNode &Ranges,
9394
9495// / Merge bits known from context-dependent facts into Known.
9596LLVM_ABI void computeKnownBitsFromContext (const Value *V, KnownBits &Known,
96- unsigned Depth ,
97- const SimplifyQuery &Q );
97+ const SimplifyQuery &Q ,
98+ unsigned Depth = 0 );
9899
99100// / Using KnownBits LHS/RHS produce the known bits for logic op (and/xor/or).
100101LLVM_ABI KnownBits analyzeKnownBitsFromAndXorOr (const Operator *I,
101102 const KnownBits &KnownLHS,
102103 const KnownBits &KnownRHS,
103- unsigned Depth ,
104- const SimplifyQuery &SQ );
104+ const SimplifyQuery &SQ ,
105+ unsigned Depth = 0 );
105106
106107// / Adjust \p Known for the given select \p Arm to include information from the
107108// / select \p Cond.
108109LLVM_ABI void adjustKnownBitsForSelectArm (KnownBits &Known, Value *Cond,
109110 Value *Arm, bool Invert,
110- unsigned Depth ,
111- const SimplifyQuery &Q );
111+ const SimplifyQuery &Q ,
112+ unsigned Depth = 0 );
112113
113114// / Return true if LHS and RHS have no common bits set.
114115LLVM_ABI bool haveNoCommonBitsSet (const WithCache<const Value *> &LHSCache,
@@ -121,14 +122,16 @@ LLVM_ABI bool haveNoCommonBitsSet(const WithCache<const Value *> &LHSCache,
121122// / vectors of integers. If 'OrZero' is set, then return true if the given
122123// / value is either a power of two or zero.
123124LLVM_ABI bool isKnownToBeAPowerOfTwo (const Value *V, const DataLayout &DL,
124- bool OrZero = false , unsigned Depth = 0 ,
125+ bool OrZero = false ,
125126 AssumptionCache *AC = nullptr ,
126127 const Instruction *CxtI = nullptr ,
127128 const DominatorTree *DT = nullptr ,
128- bool UseInstrInfo = true );
129+ bool UseInstrInfo = true ,
130+ unsigned Depth = 0 );
129131
130132LLVM_ABI bool isKnownToBeAPowerOfTwo (const Value *V, bool OrZero,
131- unsigned Depth, const SimplifyQuery &Q);
133+ const SimplifyQuery &Q,
134+ unsigned Depth = 0 );
132135
133136LLVM_ABI bool isOnlyUsedInZeroComparison (const Instruction *CxtI);
134137
@@ -196,21 +199,21 @@ LLVM_ABI bool MaskedValueIsZero(const Value *V, const APInt &Mask,
196199// / sign bits for the vector element with the mininum number of known sign
197200// / bits.
198201LLVM_ABI unsigned ComputeNumSignBits (const Value *Op, const DataLayout &DL,
199- unsigned Depth = 0 ,
200202 AssumptionCache *AC = nullptr ,
201203 const Instruction *CxtI = nullptr ,
202204 const DominatorTree *DT = nullptr ,
203- bool UseInstrInfo = true );
205+ bool UseInstrInfo = true ,
206+ unsigned Depth = 0 );
204207
205208// / Get the upper bound on bit size for this Value \p Op as a signed integer.
206209// / i.e. x == sext(trunc(x to MaxSignificantBits) to bitwidth(x)).
207210// / Similar to the APInt::getSignificantBits function.
208211LLVM_ABI unsigned ComputeMaxSignificantBits (const Value *Op,
209212 const DataLayout &DL,
210- unsigned Depth = 0 ,
211213 AssumptionCache *AC = nullptr ,
212214 const Instruction *CxtI = nullptr ,
213- const DominatorTree *DT = nullptr );
215+ const DominatorTree *DT = nullptr ,
216+ unsigned Depth = 0 );
214217
215218// / Map a call instruction to an intrinsic ID. Libcalls which have equivalent
216219// / intrinsics are treated as-if they were intrinsics.
@@ -236,36 +239,36 @@ LLVM_ABI bool isSignBitCheck(ICmpInst::Predicate Pred, const APInt &RHS,
236239LLVM_ABI KnownFPClass computeKnownFPClass (const Value *V,
237240 const APInt &DemandedElts,
238241 FPClassTest InterestedClasses,
239- unsigned Depth ,
240- const SimplifyQuery &SQ );
242+ const SimplifyQuery &SQ ,
243+ unsigned Depth = 0 );
241244
242245LLVM_ABI KnownFPClass computeKnownFPClass (const Value *V,
243246 FPClassTest InterestedClasses,
244- unsigned Depth ,
245- const SimplifyQuery &SQ );
247+ const SimplifyQuery &SQ ,
248+ unsigned Depth = 0 );
246249
247250LLVM_ABI KnownFPClass computeKnownFPClass (
248251 const Value *V, const DataLayout &DL,
249- FPClassTest InterestedClasses = fcAllFlags, unsigned Depth = 0 ,
252+ FPClassTest InterestedClasses = fcAllFlags,
250253 const TargetLibraryInfo *TLI = nullptr , AssumptionCache *AC = nullptr ,
251254 const Instruction *CxtI = nullptr , const DominatorTree *DT = nullptr ,
252- bool UseInstrInfo = true );
255+ bool UseInstrInfo = true , unsigned Depth = 0 );
253256
254257// / Wrapper to account for known fast math flags at the use instruction.
255258LLVM_ABI KnownFPClass computeKnownFPClass (
256259 const Value *V, const APInt &DemandedElts, FastMathFlags FMF,
257- FPClassTest InterestedClasses, unsigned Depth, const SimplifyQuery &SQ);
260+ FPClassTest InterestedClasses, const SimplifyQuery &SQ, unsigned Depth = 0 );
258261
259262LLVM_ABI KnownFPClass computeKnownFPClass (const Value *V, FastMathFlags FMF,
260263 FPClassTest InterestedClasses,
261- unsigned Depth ,
262- const SimplifyQuery &SQ );
264+ const SimplifyQuery &SQ ,
265+ unsigned Depth = 0 );
263266
264267// / Return true if we can prove that the specified FP value is never equal to
265268// / -0.0. Users should use caution when considering PreserveSign
266269// / denormal-fp-math.
267- LLVM_ABI bool cannotBeNegativeZero (const Value *V, unsigned Depth ,
268- const SimplifyQuery &SQ );
270+ LLVM_ABI bool cannotBeNegativeZero (const Value *V, const SimplifyQuery &SQ ,
271+ unsigned Depth = 0 );
269272
270273// / Return true if we can prove that the specified FP value is either NaN or
271274// / never less than -0.0.
@@ -275,30 +278,32 @@ LLVM_ABI bool cannotBeNegativeZero(const Value *V, unsigned Depth,
275278// / -0 --> true
276279// / x > +0 --> true
277280// / x < -0 --> false
278- LLVM_ABI bool cannotBeOrderedLessThanZero (const Value *V, unsigned Depth,
279- const SimplifyQuery &SQ);
281+ LLVM_ABI bool cannotBeOrderedLessThanZero (const Value *V,
282+ const SimplifyQuery &SQ,
283+ unsigned Depth = 0 );
280284
281285// / Return true if the floating-point scalar value is not an infinity or if
282286// / the floating-point vector value has no infinities. Return false if a value
283287// / could ever be infinity.
284- LLVM_ABI bool isKnownNeverInfinity (const Value *V, unsigned Depth ,
285- const SimplifyQuery &SQ );
288+ LLVM_ABI bool isKnownNeverInfinity (const Value *V, const SimplifyQuery &SQ ,
289+ unsigned Depth = 0 );
286290
287291// / Return true if the floating-point value can never contain a NaN or infinity.
288- LLVM_ABI bool isKnownNeverInfOrNaN (const Value *V, unsigned Depth ,
289- const SimplifyQuery &SQ );
292+ LLVM_ABI bool isKnownNeverInfOrNaN (const Value *V, const SimplifyQuery &SQ ,
293+ unsigned Depth = 0 );
290294
291295// / Return true if the floating-point scalar value is not a NaN or if the
292296// / floating-point vector value has no NaN elements. Return false if a value
293297// / could ever be NaN.
294- LLVM_ABI bool isKnownNeverNaN (const Value *V, unsigned Depth ,
295- const SimplifyQuery &SQ );
298+ LLVM_ABI bool isKnownNeverNaN (const Value *V, const SimplifyQuery &SQ ,
299+ unsigned Depth = 0 );
296300
297301// / Return false if we can prove that the specified FP value's sign bit is 0.
298302// / Return true if we can prove that the specified FP value's sign bit is 1.
299303// / Otherwise return std::nullopt.
300- LLVM_ABI std::optional<bool >
301- computeKnownFPSignBit (const Value *V, unsigned Depth, const SimplifyQuery &SQ);
304+ LLVM_ABI std::optional<bool > computeKnownFPSignBit (const Value *V,
305+ const SimplifyQuery &SQ,
306+ unsigned Depth = 0 );
302307
303308// / Return true if the sign bit of the FP value can be ignored by the user when
304309// / the value is zero.
0 commit comments