Skip to content

Commit 53755fa

Browse files
committed
Revert "Reland [llvm] add GenericFloatingPointPredicateUtils llvm#140254 (llvm#141065)"
This reverts commit 571a24c.
1 parent f855b36 commit 53755fa

14 files changed

+465
-696
lines changed

llvm/include/llvm/ADT/GenericFloatingPointPredicateUtils.h

Lines changed: 0 additions & 479 deletions
This file was deleted.

llvm/include/llvm/Analysis/FloatingPointPredicateUtils.h

Lines changed: 0 additions & 73 deletions
This file was deleted.

llvm/include/llvm/Analysis/ValueTracking.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,49 @@ Intrinsic::ID getIntrinsicForCallSite(const CallBase &CB,
213213
bool isSignBitCheck(ICmpInst::Predicate Pred, const APInt &RHS,
214214
bool &TrueIfSigned);
215215

216+
/// Returns a pair of values, which if passed to llvm.is.fpclass, returns the
217+
/// same result as an fcmp with the given operands.
218+
///
219+
/// If \p LookThroughSrc is true, consider the input value when computing the
220+
/// mask.
221+
///
222+
/// If \p LookThroughSrc is false, ignore the source value (i.e. the first pair
223+
/// element will always be LHS.
224+
std::pair<Value *, FPClassTest> fcmpToClassTest(CmpInst::Predicate Pred,
225+
const Function &F, Value *LHS,
226+
Value *RHS,
227+
bool LookThroughSrc = true);
228+
std::pair<Value *, FPClassTest> fcmpToClassTest(CmpInst::Predicate Pred,
229+
const Function &F, Value *LHS,
230+
const APFloat *ConstRHS,
231+
bool LookThroughSrc = true);
232+
233+
/// Compute the possible floating-point classes that \p LHS could be based on
234+
/// fcmp \Pred \p LHS, \p RHS.
235+
///
236+
/// \returns { TestedValue, ClassesIfTrue, ClassesIfFalse }
237+
///
238+
/// If the compare returns an exact class test, ClassesIfTrue == ~ClassesIfFalse
239+
///
240+
/// This is a less exact version of fcmpToClassTest (e.g. fcmpToClassTest will
241+
/// only succeed for a test of x > 0 implies positive, but not x > 1).
242+
///
243+
/// If \p LookThroughSrc is true, consider the input value when computing the
244+
/// mask. This may look through sign bit operations.
245+
///
246+
/// If \p LookThroughSrc is false, ignore the source value (i.e. the first pair
247+
/// element will always be LHS.
248+
///
249+
std::tuple<Value *, FPClassTest, FPClassTest>
250+
fcmpImpliesClass(CmpInst::Predicate Pred, const Function &F, Value *LHS,
251+
Value *RHS, bool LookThroughSrc = true);
252+
std::tuple<Value *, FPClassTest, FPClassTest>
253+
fcmpImpliesClass(CmpInst::Predicate Pred, const Function &F, Value *LHS,
254+
FPClassTest RHS, bool LookThroughSrc = true);
255+
std::tuple<Value *, FPClassTest, FPClassTest>
256+
fcmpImpliesClass(CmpInst::Predicate Pred, const Function &F, Value *LHS,
257+
const APFloat &RHS, bool LookThroughSrc = true);
258+
216259
/// Determine which floating-point classes are valid for \p V, and return them
217260
/// in KnownFPClass bit sets.
218261
///

llvm/include/llvm/CodeGen/MachineFloatingPointPredicateUtils.h

Lines changed: 0 additions & 46 deletions
This file was deleted.

llvm/lib/Analysis/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ add_llvm_component_library(LLVMAnalysis
7474
DXILResource.cpp
7575
DXILMetadataAnalysis.cpp
7676
EphemeralValuesCache.cpp
77-
FloatingPointPredicateUtils.cpp
7877
FunctionPropertiesAnalysis.cpp
7978
GlobalsModRef.cpp
8079
GuardUtils.cpp

llvm/lib/Analysis/FloatingPointPredicateUtils.cpp

Lines changed: 0 additions & 41 deletions
This file was deleted.

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "llvm/Analysis/CaptureTracking.h"
2727
#include "llvm/Analysis/CmpInstAnalysis.h"
2828
#include "llvm/Analysis/ConstantFolding.h"
29-
#include "llvm/Analysis/FloatingPointPredicateUtils.h"
3029
#include "llvm/Analysis/InstSimplifyFolder.h"
3130
#include "llvm/Analysis/Loads.h"
3231
#include "llvm/Analysis/LoopAnalysisManager.h"

0 commit comments

Comments
 (0)