[llvm] 95209e3 - ValueTracking: Prepare to phase out CannotBeOrderedLessThanZero
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 16:26:35 PDT 2023
Author: Matt Arsenault
Date: 2023-06-23T19:26:30-04:00
New Revision: 95209e37d7280c22cd45f5b2e740d5e29ad7a198
URL: https://github.com/llvm/llvm-project/commit/95209e37d7280c22cd45f5b2e740d5e29ad7a198
DIFF: https://github.com/llvm/llvm-project/commit/95209e37d7280c22cd45f5b2e740d5e29ad7a198.diff
LOG: ValueTracking: Prepare to phase out CannotBeOrderedLessThanZero
Introduce a full featured wrapper around computeKnownFPClass
to start replacing the uses with.
Added:
Modified:
llvm/include/llvm/Analysis/ValueTracking.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/ValueTracking.h b/llvm/include/llvm/Analysis/ValueTracking.h
index f81ed3f36e5a1..930eb85b729d4 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
More information about the llvm-commits
mailing list