LLVM 22.0.0git
Static Public Member Functions | List of all members
llvm::GenericFloatingPointPredicateUtils< ContextT > Class Template Reference

#include "llvm/IR/GenericFloatingPointPredicateUtils.h"

Static Public Member Functions

static std::pair< ValueRefT, FPClassTestfcmpToClassTest (FCmpInst::Predicate Pred, const FunctionT &F, ValueRefT LHS, ValueRefT RHS, bool LookThroughSrc)
 Returns a pair of values, which if passed to llvm.is.fpclass, returns the same result as an fcmp with the given operands.
 
static std::pair< ValueRefT, FPClassTestfcmpToClassTest (FCmpInst::Predicate Pred, const FunctionT &F, ValueRefT LHS, const APFloat &ConstRHS, bool LookThroughSrc)
 
static std::tuple< ValueRefT, FPClassTest, FPClassTestfcmpImpliesClass (CmpInst::Predicate Pred, const FunctionT &F, ValueRefT LHS, FPClassTest RHSClass, bool LookThroughSrc)
 Compute the possible floating-point classes that LHS could be based on fcmp \Pred LHS, RHS.
 
static std::tuple< ValueRefT, FPClassTest, FPClassTestfcmpImpliesClass (CmpInst::Predicate Pred, const FunctionT &F, ValueRefT LHS, const APFloat &ConstRHS, bool LookThroughSrc)
 
static std::tuple< ValueRefT, FPClassTest, FPClassTestfcmpImpliesClass (CmpInst::Predicate Pred, const FunctionT &F, ValueRefT LHS, ValueRefT RHS, bool LookThroughSrc)
 

Detailed Description

template<typename ContextT>
class llvm::GenericFloatingPointPredicateUtils< ContextT >

Definition at line 26 of file GenericFloatingPointPredicateUtils.h.

Member Function Documentation

◆ fcmpImpliesClass() [1/3]

template<typename ContextT >
static std::tuple< ValueRefT, FPClassTest, FPClassTest > llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpImpliesClass ( CmpInst::Predicate  Pred,
const FunctionT &  F,
ValueRefT  LHS,
const APFloat ConstRHS,
bool  LookThroughSrc 
)
inlinestatic

◆ fcmpImpliesClass() [2/3]

template<typename ContextT >
static std::tuple< ValueRefT, FPClassTest, FPClassTest > llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpImpliesClass ( CmpInst::Predicate  Pred,
const FunctionT &  F,
ValueRefT  LHS,
FPClassTest  RHSClass,
bool  LookThroughSrc 
)
inlinestatic

Compute the possible floating-point classes that LHS could be based on fcmp \Pred LHS, RHS.

Returns
{ TestedValue, ClassesIfTrue, ClassesIfFalse }

If the compare returns an exact class test, ClassesIfTrue == ~ClassesIfFalse

This is a less exact version of fcmpToClassTest (e.g. fcmpToClassTest will only succeed for a test of x > 0 implies positive, but not x > 1).

If LookThroughSrc is true, consider the input value when computing the mask. This may look through sign bit operations.

If LookThroughSrc is false, ignore the source value (i.e. the first pair element will always be LHS.

Definition at line 93 of file GenericFloatingPointPredicateUtils.h.

References assert(), F, llvm::fcAllFlags, llvm::fcFinite, llvm::fcInf, llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_OGE, llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLE, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UGE, llvm::CmpInst::FCMP_UGT, llvm::CmpInst::FCMP_ULE, llvm::CmpInst::FCMP_ULT, llvm::CmpInst::FCMP_UNE, llvm::CmpInst::FCMP_UNO, llvm::fcNan, llvm::fcNegative, llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcNone, llvm::fcNormal, llvm::fcPosInf, llvm::fcPositive, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcSubnormal, llvm::fcZero, llvm::DenormalMode::IEEE, llvm::Invalid, llvm::inverse_fabs(), llvm::CmpInst::isOrdered(), llvm::CmpInst::isUnordered(), LHS, llvm_unreachable, and Mode.

Referenced by llvm::fcmpImpliesClass(), llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpImpliesClass(), and llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpToClassTest().

◆ fcmpImpliesClass() [3/3]

template<typename ContextT >
static std::tuple< ValueRefT, FPClassTest, FPClassTest > llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpImpliesClass ( CmpInst::Predicate  Pred,
const FunctionT &  F,
ValueRefT  LHS,
ValueRefT  RHS,
bool  LookThroughSrc 
)
inlinestatic

◆ fcmpToClassTest() [1/2]

template<typename ContextT >
static std::pair< ValueRefT, FPClassTest > llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpToClassTest ( FCmpInst::Predicate  Pred,
const FunctionT &  F,
ValueRefT  LHS,
const APFloat ConstRHS,
bool  LookThroughSrc 
)
inlinestatic

◆ fcmpToClassTest() [2/2]

template<typename ContextT >
static std::pair< ValueRefT, FPClassTest > llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpToClassTest ( FCmpInst::Predicate  Pred,
const FunctionT &  F,
ValueRefT  LHS,
ValueRefT  RHS,
bool  LookThroughSrc 
)
inlinestatic

Returns a pair of values, which if passed to llvm.is.fpclass, returns the same result as an fcmp with the given operands.

Definition at line 53 of file GenericFloatingPointPredicateUtils.h.

References F, llvm::fcAllFlags, llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpToClassTest(), llvm::Invalid, LHS, and RHS.

Referenced by llvm::fcmpToClassTest(), and llvm::GenericFloatingPointPredicateUtils< ContextT >::fcmpToClassTest().


The documentation for this class was generated from the following file: