An floating‐point‐like constant.

Synopsis

Declared in <llvm/CodeGen/GlobalISel/Utils.h>

class GFConstant;

Description

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.

Enums

Name

Description

GFConstantKind

Shape of the floating‐point‐like constant.

Member Functions

Name

Description

GFConstant [constructor]

Constructors

begin

Iterator to the first element of a scalar or fixed‐vector constant.

end

Iterator past the last element of a scalar or fixed‐vector constant.

getKind

Returns the kind of of this constant, e.g, Scalar.

getScalarValue

Returns the value, if this constant is a scalar.

size

Number of elements in a fixed‐vector constant.

Static Member Functions

Name

Description

getConstant

Build a GFConstant from a register if it is a known float constant.

Created with MrDocs