LLVM: llvm::GIConstant Class Reference (original) (raw)
An integer-like constant. More...
#include "[llvm/CodeGen/GlobalISel/Utils.h](CodeGen%5F2GlobalISel%5F2Utils%5F8h%5Fsource.html)"
| Public Types | |
|---|---|
| enum class | GIConstantKind { Scalar, FixedVector, ScalableVector } |
| Public Member Functions | |
|---|---|
| GIConstant (ArrayRef< APInt > Values) | |
| GIConstant (const APInt &Value, GIConstantKind Kind) | |
| GIConstantKind | getKind () const |
| Returns the kind of of this constant, e.g, Scalar. | |
| LLVM_ABI APInt | getScalarValue () const |
| Returns the value, if this constant is a scalar. |
Detailed Description
An integer-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 APInt, 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.
Definition at line 649 of file Utils.h.
Member Enumeration Documentation
◆ GIConstantKind
| Enumerator |
|---|
| Scalar |
| FixedVector |
| ScalableVector |
Definition at line 651 of file Utils.h.
Constructor & Destructor Documentation
◆ GIConstant() [2/2]
| llvm::GIConstant::GIConstant ( const APInt & Value, GIConstantKind Kind ) | inline |
|---|
Member Function Documentation
◆ getConstant()
◆ getKind()
| GIConstantKind llvm::GIConstant::getKind ( ) const | inline |
|---|
Returns the kind of of this constant, e.g, Scalar.
Definition at line 665 of file Utils.h.
◆ getScalarValue()
| APInt llvm::GIConstant::getScalarValue | ( | ) | const |
|---|
The documentation for this class was generated from the following files: