MLIR 24.0.0git
LLVMConstantOps.cpp File Reference
#include "mlir/Dialect/LLVMIR/LLVMConstantOps.h"
#include "mlir/Dialect/LLVMIR/LLVMModuleOps.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/DialectImplementation.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "mlir/Dialect/LLVMIR/LLVMConstantOps.cpp.inc"

Go to the source code of this file.

Macros

#define GET_OP_CLASSES

Functions

static int64_t getNumElements (Type t)
 Compute the total number of elements in the given type, also taking into account nested types.
static bool hasScalableVectorType (Type t)
 Check if the given type is a scalable vector type or a vector/array type that contains a nested scalable vector type.
static LogicalResult verifyStructArrayConstant (LLVM::ConstantOp op, LLVM::LLVMArrayType arrayType, ArrayAttr arrayAttr, int dim)
 Verifies the constant array represented by arrayAttr matches the provided arrayType.

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 528 of file LLVMConstantOps.cpp.

Function Documentation

◆ getNumElements()

int64_t getNumElements ( Type t)
static

Compute the total number of elements in the given type, also taking into account nested types.

Supported types are VectorType and LLVMArrayType. Everything else is treated as a scalar.

Definition at line 184 of file LLVMConstantOps.cpp.

References getNumElements().

Referenced by mlir::LLVM::detail::extractNDVectorTypeInfo(), getNumElements(), mlir::DenseElementsAttr::tryGetComplexFloatValues(), mlir::DenseElementsAttr::tryGetComplexIntValues(), and verifyFloatIntegerBuiltin().

◆ hasScalableVectorType()

bool hasScalableVectorType ( Type t)
static

Check if the given type is a scalable vector type or a vector/array type that contains a nested scalable vector type.

Definition at line 210 of file LLVMConstantOps.cpp.

References hasScalableVectorType().

Referenced by hasScalableVectorType().

◆ verifyStructArrayConstant()

LogicalResult verifyStructArrayConstant ( LLVM::ConstantOp op,
LLVM::LLVMArrayType arrayType,
ArrayAttr arrayAttr,
int dim )
static

Verifies the constant array represented by arrayAttr matches the provided arrayType.

Definition at line 223 of file LLVMConstantOps.cpp.

References ArrayAttr(), success(), and verifyStructArrayConstant().

Referenced by verifyStructArrayConstant().