LLVM 20.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. | |
APFloat | getScalarValue () const |
Returns the value, if this constant is a scalar. | |
Static Public Member Functions | |
static 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 |
Definition at line 656 of file Utils.h.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Definition at line 2014 of file Utils.cpp.
References llvm::getDefIgnoringCopies(), llvm::getFConstantVRegValWithLookThrough(), I, MRI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), ScalableVector, Scalar, and llvm::Splat.
Referenced by llvm::CombinerHelper::matchCanonicalizeFCmp().
|
inline |
APFloat llvm::GFConstant::getScalarValue | ( | ) | const |