Skip to content

Commit

Permalink
ValueTracking: Prepare to phase out CannotBeOrderedLessThanZero
Browse files Browse the repository at this point in the history
Introduce a full featured wrapper around computeKnownFPClass
to start replacing the uses with.
  • Loading branch information
arsenm committed Jun 23, 2023
1 parent 44265dc commit 95209e3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions llvm/include/llvm/Analysis/ValueTracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@ KnownFPClass computeKnownFPClass(
bool CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,
unsigned Depth = 0);


bool CannotBeOrderedLessThanZero(const Value *V, const DataLayout &DL,
const TargetLibraryInfo *TLI);

/// Return true if we can prove that the specified FP value is either NaN or
/// never less than -0.0.
///
Expand All @@ -466,8 +470,18 @@ bool CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,
/// -0 --> true
/// x > +0 --> true
/// x < -0 --> false
bool CannotBeOrderedLessThanZero(const Value *V, const DataLayout &DL,
const TargetLibraryInfo *TLI);
inline bool cannotBeOrderedLessThanZero(const Value *V, const DataLayout &DL,
const TargetLibraryInfo *TLI = nullptr,
unsigned Depth = 0,
AssumptionCache *AC = nullptr,
const Instruction *CtxI = nullptr,
const DominatorTree *DT = nullptr,
bool UseInstrInfo = true) {
KnownFPClass Known =
computeKnownFPClass(V, DL, KnownFPClass::OrderedLessThanZeroMask, Depth,
TLI, AC, CtxI, DT, UseInstrInfo);
return Known.cannotBeOrderedLessThanZero();
}

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

0 comments on commit 95209e3

Please sign in to comment.