LLVM 22.0.0git
|
#include "llvm/IR/ConstantFPRange.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/FloatingPointMode.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
Go to the source code of this file.
Classes | |
struct | SameSignRange |
Represent a contiguous range of values sharing the same sign. More... |
Functions | |
static APFloat::cmpResult | strictCompare (const APFloat &LHS, const APFloat &RHS) |
static bool | isNonCanonicalEmptySet (const APFloat &Lower, const APFloat &Upper) |
static void | canonicalizeRange (APFloat &Lower, APFloat &Upper) |
static bool | fcmpPredExcludesEqual (FCmpInst::Predicate Pred) |
Return true for ULT/UGT/OLT/OGT. | |
static ConstantFPRange | makeLessThan (APFloat V, FCmpInst::Predicate Pred) |
Return [-inf, V) or [-inf, V]. | |
static ConstantFPRange | makeGreaterThan (APFloat V, FCmpInst::Predicate Pred) |
Return (V, +inf] or [V, +inf]. | |
static ConstantFPRange | extendZeroIfEqual (const ConstantFPRange &CR, FCmpInst::Predicate Pred) |
Make sure that +0/-0 are both included in the range. | |
static ConstantFPRange | setNaNField (const ConstantFPRange &CR, FCmpInst::Predicate Pred) |
static bool | removeInf (APFloat &Lower, APFloat &Upper, bool &HasPosInf, bool &HasNegInf) |
Return true if the finite part is not empty after removing infinities. | |
static void | splitPosNeg (const APFloat &Lower, const APFloat &Upper, std::optional< SameSignRange > &NegPart, std::optional< SameSignRange > &PosPart) |
Split the range into positive and negative components. |
Definition at line 77 of file ConstantFPRange.cpp.
References llvm::APFloat::getInf(), isNonCanonicalEmptySet(), llvm::Lower, and llvm::Upper.
Referenced by llvm::ConstantFPRange::getWithoutInf(), and llvm::ConstantFPRange::intersectWith().
|
static |
Make sure that +0/-0 are both included in the range.
Definition at line 142 of file ConstantFPRange.cpp.
References llvm::ConstantFPRange::containsQNaN(), llvm::ConstantFPRange::containsSNaN(), fcmpPredExcludesEqual(), llvm::ConstantFPRange::getLower(), llvm::ConstantFPRange::getUpper(), llvm::APFloat::getZero(), llvm::Lower, and llvm::Upper.
Referenced by llvm::ConstantFPRange::makeAllowedFCmpRegion(), and llvm::ConstantFPRange::makeSatisfyingFCmpRegion().
|
static |
Return true for ULT/UGT/OLT/OGT.
Definition at line 113 of file ConstantFPRange.cpp.
References llvm::CmpInst::FCMP_OEQ.
Referenced by extendZeroIfEqual(), makeGreaterThan(), and makeLessThan().
Definition at line 72 of file ConstantFPRange.cpp.
References llvm::APFloatBase::cmpGreaterThan, llvm::Lower, strictCompare(), and llvm::Upper.
Referenced by canonicalizeRange(), and llvm::ConstantFPRange::ConstantFPRange().
|
static |
Return (V, +inf] or [V, +inf].
Definition at line 130 of file ConstantFPRange.cpp.
References fcmpPredExcludesEqual(), llvm::APFloat::getInf(), and llvm::ConstantFPRange::getNonNaN().
Referenced by llvm::ConstantFPRange::makeAllowedFCmpRegion(), and llvm::ConstantFPRange::makeSatisfyingFCmpRegion().
|
static |
Return [-inf, V) or [-inf, V].
Definition at line 118 of file ConstantFPRange.cpp.
References fcmpPredExcludesEqual(), llvm::APFloat::getInf(), and llvm::ConstantFPRange::getNonNaN().
Referenced by llvm::ConstantFPRange::makeAllowedFCmpRegion(), and llvm::ConstantFPRange::makeSatisfyingFCmpRegion().
Return true if the finite part is not empty after removing infinities.
Definition at line 419 of file ConstantFPRange.cpp.
References assert(), llvm::APFloatBase::cmpGreaterThan, llvm::APFloat::getLargest(), llvm::Lower, strictCompare(), and llvm::Upper.
Referenced by llvm::ConstantFPRange::add(), and llvm::ConstantFPRange::getWithoutInf().
|
static |
Definition at line 157 of file ConstantFPRange.cpp.
References llvm::ConstantFPRange::getLower(), llvm::ConstantFPRange::getUpper(), and llvm::CmpInst::isUnordered().
Referenced by llvm::ConstantFPRange::makeAllowedFCmpRegion(), and llvm::ConstantFPRange::makeSatisfyingFCmpRegion().
|
static |
Split the range into positive and negative components.
Definition at line 555 of file ConstantFPRange.cpp.
References llvm::abs(), assert(), llvm::APFloatBase::cmpGreaterThan, llvm::APFloat::getZero(), llvm::Lower, strictCompare(), and llvm::Upper.
Referenced by llvm::ConstantFPRange::div(), and llvm::ConstantFPRange::mul().
Definition at line 61 of file ConstantFPRange.cpp.
References assert(), llvm::APFloatBase::cmpEqual, llvm::APFloatBase::cmpGreaterThan, llvm::APFloatBase::cmpLessThan, LHS, and RHS.
Referenced by llvm::ConstantFPRange::contains(), llvm::ConstantFPRange::contains(), isNonCanonicalEmptySet(), removeInf(), SameSignRange::SameSignRange(), and splitPosNeg().