From 95209e37d7280c22cd45f5b2e740d5e29ad7a198 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 18 Apr 2023 19:41:56 -0400 Subject: [PATCH] ValueTracking: Prepare to phase out CannotBeOrderedLessThanZero Introduce a full featured wrapper around computeKnownFPClass to start replacing the uses with. --- llvm/include/llvm/Analysis/ValueTracking.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/Analysis/ValueTracking.h b/llvm/include/llvm/Analysis/ValueTracking.h index f81ed3f..930eb85 100644 --- a/llvm/include/llvm/Analysis/ValueTracking.h +++ b/llvm/include/llvm/Analysis/ValueTracking.h @@ -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. /// @@ -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 -- 2.7.4