class ConstantDataVector

Declaration

class ConstantDataVector : public ConstantDataSequential { /* full declaration omitted */ };

Description

A vector constant whose element type is a simple 1/2/4/8-byte integer or float/double, and whose elements are just simple data values (i.e. ConstantInt/ConstantFP). This Constant node has no operands because it stores all of the elements of the constant as densely packed data, instead of as Value*'s.

Declared at: llvm/include/llvm/IR/Constants.h:753

Inherits from: ConstantDataSequential

Member Variables

private bool IsSplatSet
private bool IsSplat

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasMetadata
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 32
public static MaximumAlignment = 1ULL << MaxAlignmentExponent

Method Overview

  • public ConstantDataVector(const llvm::ConstantDataVector &)
  • private ConstantDataVector(llvm::Type * ty, const char * Data)
  • public static bool classof(const llvm::Value * V)
  • public static llvm::Constant * get(llvm::LLVMContext & Context, ArrayRef<uint8_t> Elts)
  • public static llvm::Constant * get(llvm::LLVMContext & Context, ArrayRef<uint16_t> Elts)
  • public static llvm::Constant * get(llvm::LLVMContext & Context, ArrayRef<uint32_t> Elts)
  • public static llvm::Constant * get(llvm::LLVMContext & Context, ArrayRef<uint64_t> Elts)
  • public static llvm::Constant * get(llvm::LLVMContext & Context, ArrayRef<float> Elts)
  • public static llvm::Constant * get(llvm::LLVMContext & Context, ArrayRef<double> Elts)
  • public static llvm::Constant * getFP(llvm::Type * ElementType, ArrayRef<uint16_t> Elts)
  • public static llvm::Constant * getFP(llvm::Type * ElementType, ArrayRef<uint32_t> Elts)
  • public static llvm::Constant * getFP(llvm::Type * ElementType, ArrayRef<uint64_t> Elts)
  • public static llvm::Constant * getRaw(llvm::StringRef Data, uint64_t NumElements, llvm::Type * ElementTy)
  • public static llvm::Constant * getSplat(unsigned int NumElts, llvm::Constant * Elt)
  • public llvm::Constant * getSplatValue() const
  • public inline llvm::FixedVectorType * getType() const
  • public bool isSplat() const
  • private bool isSplatData() const

Inherited from ConstantDataSequential:

Inherited from ConstantData:

Inherited from Constant:

Inherited from User:

Inherited from Value:

Methods

ConstantDataVector(
    const llvm::ConstantDataVector&)

Declared at: llvm/include/llvm/IR/Constants.h:765

Parameters

const llvm::ConstantDataVector&

ConstantDataVector(llvm::Type* ty,
                   const char* Data)

Declared at: llvm/include/llvm/IR/Constants.h:756

Parameters

llvm::Type* ty
const char* Data

static bool classof(const llvm::Value* V)

Description

Methods for support type inquiry through isa, cast, and dyn_cast:

Declared at: llvm/include/llvm/IR/Constants.h:819

Parameters

const llvm::Value* V

static llvm::Constant* get(
    llvm::LLVMContext& Context,
    ArrayRef<uint8_t> Elts)

Description

get() constructors - Return a constant with vector type with an element count and element type matching the ArrayRef passed in. Note that this can return a ConstantAggregateZero object.

Declared at: llvm/include/llvm/IR/Constants.h:770

Parameters

llvm::LLVMContext& Context
ArrayRef<uint8_t> Elts

static llvm::Constant* get(
    llvm::LLVMContext& Context,
    ArrayRef<uint16_t> Elts)

Declared at: llvm/include/llvm/IR/Constants.h:771

Parameters

llvm::LLVMContext& Context
ArrayRef<uint16_t> Elts

static llvm::Constant* get(
    llvm::LLVMContext& Context,
    ArrayRef<uint32_t> Elts)

Declared at: llvm/include/llvm/IR/Constants.h:772

Parameters

llvm::LLVMContext& Context
ArrayRef<uint32_t> Elts

static llvm::Constant* get(
    llvm::LLVMContext& Context,
    ArrayRef<uint64_t> Elts)

Declared at: llvm/include/llvm/IR/Constants.h:773

Parameters

llvm::LLVMContext& Context
ArrayRef<uint64_t> Elts

static llvm::Constant* get(
    llvm::LLVMContext& Context,
    ArrayRef<float> Elts)

Declared at: llvm/include/llvm/IR/Constants.h:774

Parameters

llvm::LLVMContext& Context
ArrayRef<float> Elts

static llvm::Constant* get(
    llvm::LLVMContext& Context,
    ArrayRef<double> Elts)

Declared at: llvm/include/llvm/IR/Constants.h:775

Parameters

llvm::LLVMContext& Context
ArrayRef<double> Elts

static llvm::Constant* getFP(
    llvm::Type* ElementType,
    ArrayRef<uint16_t> Elts)

Description

getFP() constructors - Return a constant of vector type with a float element type taken from argument `ElementType', and count taken from argument `Elts'. The amount of bits of the contained type must match the number of bits of the type contained in the passed in ArrayRef. (i.e. half or bfloat for 16bits, float for 32bits, double for 64bits) Note that this can return a ConstantAggregateZero object.

Declared at: llvm/include/llvm/IR/Constants.h:795

Parameters

llvm::Type* ElementType
ArrayRef<uint16_t> Elts

static llvm::Constant* getFP(
    llvm::Type* ElementType,
    ArrayRef<uint32_t> Elts)

Declared at: llvm/include/llvm/IR/Constants.h:796

Parameters

llvm::Type* ElementType
ArrayRef<uint32_t> Elts

static llvm::Constant* getFP(
    llvm::Type* ElementType,
    ArrayRef<uint64_t> Elts)

Declared at: llvm/include/llvm/IR/Constants.h:797

Parameters

llvm::Type* ElementType
ArrayRef<uint64_t> Elts

static llvm::Constant* getRaw(
    llvm::StringRef Data,
    uint64_t NumElements,
    llvm::Type* ElementTy)

Description

getRaw() constructor - Return a constant with vector type with an element count and element type matching the NumElements and ElementTy parameters passed in. Note that this can return a ConstantAggregateZero object. ElementTy must be one of i8/i16/i32/i64/half/bfloat/float/double. Data is the buffer containing the elements. Be careful to make sure Data uses the right endianness, the buffer will be used as-is.

Declared at: llvm/include/llvm/IR/Constants.h:783

Parameters

llvm::StringRef Data
uint64_t NumElements
llvm::Type* ElementTy

static llvm::Constant* getSplat(
    unsigned int NumElts,
    llvm::Constant* Elt)

Description

Return a ConstantVector with the specified constant in each element. The specified constant has to be a of a compatible type (i8/i16/ i32/i64/half/bfloat/float/double) and must be a ConstantFP or ConstantInt.

Declared at: llvm/include/llvm/IR/Constants.h:802

Parameters

unsigned int NumElts
llvm::Constant* Elt

llvm::Constant* getSplatValue() const

Description

If this is a splat constant, meaning that all of the elements have the same value, return that value. Otherwise return NULL.

Declared at: llvm/include/llvm/IR/Constants.h:810

inline llvm::FixedVectorType* getType() const

Description

Specialize the getType() method to always return a FixedVectorType, which reduces the amount of casting needed in parts of the compiler.

Declared at: llvm/include/llvm/IR/Constants.h:814

bool isSplat() const

Description

Returns true if this is a splat constant, meaning that all elements have the same value.

Declared at: llvm/include/llvm/IR/Constants.h:806

bool isSplatData() const

Declared at: llvm/include/llvm/IR/Constants.h:762