LLVM 22.0.0git
|
An floating-point-like constant. More...
#include "llvm/CodeGen/GlobalISel/Utils.h"
Public Types | |
enum class | GFConstantKind { Scalar , FixedVector , ScalableVector } |
Public Member Functions | |
GFConstant (ArrayRef< APFloat > Values) | |
GFConstant (const APFloat &Value, GFConstantKind Kind) | |
GFConstantKind | getKind () const |
Returns the kind of of this constant, e.g, Scalar. | |
const_iterator | begin () const |
const_iterator | end () const |
size_t | size () const |
LLVM_ABI APFloat | getScalarValue () const |
Returns the value, if this constant is a scalar. |
Static Public Member Functions | |
static LLVM_ABI std::optional< GFConstant > | getConstant (Register Const, const MachineRegisterInfo &MRI) |
An floating-point-like constant.
It abstracts over scalar, fixed-length vectors, and scalable vectors. In the common case, it provides a common API and feels like an APFloat, while still providing low-level access. It can be used for constant-folding.
bool isZero() abstracts over the kind.
switch(const.getKind()) { } provides low-level access.
|
strong |
|
inline |
|
inline |
Definition at line 712 of file Utils.h.
References assert(), and ScalableVector.
|
inline |
Definition at line 718 of file Utils.h.
References assert(), and ScalableVector.
|
static |
Definition at line 2098 of file Utils.cpp.
References llvm::dyn_cast(), llvm::getDefIgnoringCopies(), llvm::getFConstantVRegValWithLookThrough(), GFConstant(), I, MRI, ScalableVector, Scalar, and llvm::Splat.
Referenced by llvm::CombinerHelper::matchCanonicalizeFCmp().
|
inline |
APFloat llvm::GFConstant::getScalarValue | ( | ) | const |
|
inline |
Definition at line 724 of file Utils.h.
References assert(), and FixedVector.