@@ -54,36 +54,37 @@ constexpr unsigned MaxAnalysisRecursionDepth = 6;
54
54
// / same width as the vector element, and the bit is set only if it is true
55
55
// / for all of the elements in the vector.
56
56
LLVM_ABI void computeKnownBits (const Value *V, KnownBits &Known,
57
- const DataLayout &DL, unsigned Depth = 0 ,
57
+ const DataLayout &DL,
58
58
AssumptionCache *AC = nullptr ,
59
59
const Instruction *CxtI = nullptr ,
60
60
const DominatorTree *DT = nullptr ,
61
- bool UseInstrInfo = true );
61
+ bool UseInstrInfo = true , unsigned Depth = 0 );
62
62
63
63
// / Returns the known bits rather than passing by reference.
64
64
LLVM_ABI KnownBits computeKnownBits (const Value *V, const DataLayout &DL,
65
- unsigned Depth = 0 ,
66
65
AssumptionCache *AC = nullptr ,
67
66
const Instruction *CxtI = nullptr ,
68
67
const DominatorTree *DT = nullptr ,
69
- bool UseInstrInfo = true );
68
+ bool UseInstrInfo = true ,
69
+ unsigned Depth = 0 );
70
70
71
71
// / Returns the known bits rather than passing by reference.
72
72
LLVM_ABI KnownBits computeKnownBits (const Value *V, const APInt &DemandedElts,
73
- const DataLayout &DL, unsigned Depth = 0 ,
73
+ const DataLayout &DL,
74
74
AssumptionCache *AC = nullptr ,
75
75
const Instruction *CxtI = nullptr ,
76
76
const DominatorTree *DT = nullptr ,
77
- bool UseInstrInfo = true );
77
+ bool UseInstrInfo = true ,
78
+ unsigned Depth = 0 );
78
79
79
80
LLVM_ABI KnownBits computeKnownBits (const Value *V, const APInt &DemandedElts,
80
- unsigned Depth, const SimplifyQuery &Q);
81
+ const SimplifyQuery &Q, unsigned Depth = 0 );
81
82
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 );
84
85
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 );
87
88
88
89
// / Compute known bits from the range metadata.
89
90
// / \p KnownZero the set of bits that are known to be zero
@@ -93,22 +94,22 @@ LLVM_ABI void computeKnownBitsFromRangeMetadata(const MDNode &Ranges,
93
94
94
95
// / Merge bits known from context-dependent facts into Known.
95
96
LLVM_ABI void computeKnownBitsFromContext (const Value *V, KnownBits &Known,
96
- unsigned Depth ,
97
- const SimplifyQuery &Q );
97
+ const SimplifyQuery &Q ,
98
+ unsigned Depth = 0 );
98
99
99
100
// / Using KnownBits LHS/RHS produce the known bits for logic op (and/xor/or).
100
101
LLVM_ABI KnownBits analyzeKnownBitsFromAndXorOr (const Operator *I,
101
102
const KnownBits &KnownLHS,
102
103
const KnownBits &KnownRHS,
103
- unsigned Depth ,
104
- const SimplifyQuery &SQ );
104
+ const SimplifyQuery &SQ ,
105
+ unsigned Depth = 0 );
105
106
106
107
// / Adjust \p Known for the given select \p Arm to include information from the
107
108
// / select \p Cond.
108
109
LLVM_ABI void adjustKnownBitsForSelectArm (KnownBits &Known, Value *Cond,
109
110
Value *Arm, bool Invert,
110
- unsigned Depth ,
111
- const SimplifyQuery &Q );
111
+ const SimplifyQuery &Q ,
112
+ unsigned Depth = 0 );
112
113
113
114
// / Return true if LHS and RHS have no common bits set.
114
115
LLVM_ABI bool haveNoCommonBitsSet (const WithCache<const Value *> &LHSCache,
@@ -121,14 +122,16 @@ LLVM_ABI bool haveNoCommonBitsSet(const WithCache<const Value *> &LHSCache,
121
122
// / vectors of integers. If 'OrZero' is set, then return true if the given
122
123
// / value is either a power of two or zero.
123
124
LLVM_ABI bool isKnownToBeAPowerOfTwo (const Value *V, const DataLayout &DL,
124
- bool OrZero = false , unsigned Depth = 0 ,
125
+ bool OrZero = false ,
125
126
AssumptionCache *AC = nullptr ,
126
127
const Instruction *CxtI = nullptr ,
127
128
const DominatorTree *DT = nullptr ,
128
- bool UseInstrInfo = true );
129
+ bool UseInstrInfo = true ,
130
+ unsigned Depth = 0 );
129
131
130
132
LLVM_ABI bool isKnownToBeAPowerOfTwo (const Value *V, bool OrZero,
131
- unsigned Depth, const SimplifyQuery &Q);
133
+ const SimplifyQuery &Q,
134
+ unsigned Depth = 0 );
132
135
133
136
LLVM_ABI bool isOnlyUsedInZeroComparison (const Instruction *CxtI);
134
137
@@ -196,21 +199,21 @@ LLVM_ABI bool MaskedValueIsZero(const Value *V, const APInt &Mask,
196
199
// / sign bits for the vector element with the mininum number of known sign
197
200
// / bits.
198
201
LLVM_ABI unsigned ComputeNumSignBits (const Value *Op, const DataLayout &DL,
199
- unsigned Depth = 0 ,
200
202
AssumptionCache *AC = nullptr ,
201
203
const Instruction *CxtI = nullptr ,
202
204
const DominatorTree *DT = nullptr ,
203
- bool UseInstrInfo = true );
205
+ bool UseInstrInfo = true ,
206
+ unsigned Depth = 0 );
204
207
205
208
// / Get the upper bound on bit size for this Value \p Op as a signed integer.
206
209
// / i.e. x == sext(trunc(x to MaxSignificantBits) to bitwidth(x)).
207
210
// / Similar to the APInt::getSignificantBits function.
208
211
LLVM_ABI unsigned ComputeMaxSignificantBits (const Value *Op,
209
212
const DataLayout &DL,
210
- unsigned Depth = 0 ,
211
213
AssumptionCache *AC = nullptr ,
212
214
const Instruction *CxtI = nullptr ,
213
- const DominatorTree *DT = nullptr );
215
+ const DominatorTree *DT = nullptr ,
216
+ unsigned Depth = 0 );
214
217
215
218
// / Map a call instruction to an intrinsic ID. Libcalls which have equivalent
216
219
// / intrinsics are treated as-if they were intrinsics.
@@ -236,36 +239,36 @@ LLVM_ABI bool isSignBitCheck(ICmpInst::Predicate Pred, const APInt &RHS,
236
239
LLVM_ABI KnownFPClass computeKnownFPClass (const Value *V,
237
240
const APInt &DemandedElts,
238
241
FPClassTest InterestedClasses,
239
- unsigned Depth ,
240
- const SimplifyQuery &SQ );
242
+ const SimplifyQuery &SQ ,
243
+ unsigned Depth = 0 );
241
244
242
245
LLVM_ABI KnownFPClass computeKnownFPClass (const Value *V,
243
246
FPClassTest InterestedClasses,
244
- unsigned Depth ,
245
- const SimplifyQuery &SQ );
247
+ const SimplifyQuery &SQ ,
248
+ unsigned Depth = 0 );
246
249
247
250
LLVM_ABI KnownFPClass computeKnownFPClass (
248
251
const Value *V, const DataLayout &DL,
249
- FPClassTest InterestedClasses = fcAllFlags, unsigned Depth = 0 ,
252
+ FPClassTest InterestedClasses = fcAllFlags,
250
253
const TargetLibraryInfo *TLI = nullptr , AssumptionCache *AC = nullptr ,
251
254
const Instruction *CxtI = nullptr , const DominatorTree *DT = nullptr ,
252
- bool UseInstrInfo = true );
255
+ bool UseInstrInfo = true , unsigned Depth = 0 );
253
256
254
257
// / Wrapper to account for known fast math flags at the use instruction.
255
258
LLVM_ABI KnownFPClass computeKnownFPClass (
256
259
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 );
258
261
259
262
LLVM_ABI KnownFPClass computeKnownFPClass (const Value *V, FastMathFlags FMF,
260
263
FPClassTest InterestedClasses,
261
- unsigned Depth ,
262
- const SimplifyQuery &SQ );
264
+ const SimplifyQuery &SQ ,
265
+ unsigned Depth = 0 );
263
266
264
267
// / Return true if we can prove that the specified FP value is never equal to
265
268
// / -0.0. Users should use caution when considering PreserveSign
266
269
// / 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 );
269
272
270
273
// / Return true if we can prove that the specified FP value is either NaN or
271
274
// / never less than -0.0.
@@ -275,30 +278,32 @@ LLVM_ABI bool cannotBeNegativeZero(const Value *V, unsigned Depth,
275
278
// / -0 --> true
276
279
// / x > +0 --> true
277
280
// / 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 );
280
284
281
285
// / Return true if the floating-point scalar value is not an infinity or if
282
286
// / the floating-point vector value has no infinities. Return false if a value
283
287
// / 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 );
286
290
287
291
// / 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 );
290
294
291
295
// / Return true if the floating-point scalar value is not a NaN or if the
292
296
// / floating-point vector value has no NaN elements. Return false if a value
293
297
// / 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 );
296
300
297
301
// / Return false if we can prove that the specified FP value's sign bit is 0.
298
302
// / Return true if we can prove that the specified FP value's sign bit is 1.
299
303
// / 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 );
302
307
303
308
// / Return true if the sign bit of the FP value can be ignored by the user when
304
309
// / the value is zero.
0 commit comments