Skip to content

Commit 95209e3

Browse files
committed
ValueTracking: Prepare to phase out CannotBeOrderedLessThanZero
Introduce a full featured wrapper around computeKnownFPClass to start replacing the uses with.
1 parent 44265dc commit 95209e3

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

llvm/include/llvm/Analysis/ValueTracking.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@ KnownFPClass computeKnownFPClass(
458458
bool CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,
459459
unsigned Depth = 0);
460460

461+
462+
bool CannotBeOrderedLessThanZero(const Value *V, const DataLayout &DL,
463+
const TargetLibraryInfo *TLI);
464+
461465
/// Return true if we can prove that the specified FP value is either NaN or
462466
/// never less than -0.0.
463467
///
@@ -466,8 +470,18 @@ bool CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,
466470
/// -0 --> true
467471
/// x > +0 --> true
468472
/// x < -0 --> false
469-
bool CannotBeOrderedLessThanZero(const Value *V, const DataLayout &DL,
470-
const TargetLibraryInfo *TLI);
473+
inline bool cannotBeOrderedLessThanZero(const Value *V, const DataLayout &DL,
474+
const TargetLibraryInfo *TLI = nullptr,
475+
unsigned Depth = 0,
476+
AssumptionCache *AC = nullptr,
477+
const Instruction *CtxI = nullptr,
478+
const DominatorTree *DT = nullptr,
479+
bool UseInstrInfo = true) {
480+
KnownFPClass Known =
481+
computeKnownFPClass(V, DL, KnownFPClass::OrderedLessThanZeroMask, Depth,
482+
TLI, AC, CtxI, DT, UseInstrInfo);
483+
return Known.cannotBeOrderedLessThanZero();
484+
}
471485

472486
/// Return true if the floating-point scalar value is not an infinity or if
473487
/// the floating-point vector value has no infinities. Return false if a value

0 commit comments

Comments
 (0)