MLIR 24.0.0git
LLVMAggregateOps.cpp File Reference
#include "mlir/Dialect/LLVMIR/LLVMAggregateOps.h"
#include "IR/LLVMOps.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Dialect/LLVMIR/LLVMAggregateOps.cpp.inc"

Go to the source code of this file.

Macros

#define GET_OP_CLASSES

Functions

static Type getInsertExtractValueElementType (function_ref< InFlightDiagnostic(StringRef)> emitError, Type containerType, ArrayRef< int64_t > position)
 Extract the type at position in the LLVM IR aggregate type containerType.
static Type getInsertExtractValueElementType (Type llvmType, ArrayRef< int64_t > position)
 Extract the type at position in the wrapped LLVM IR aggregate type containerType.
static Attribute extractElementAt (Attribute attr, size_t index)
 Extracts the element at the given index from an attribute.

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 340 of file LLVMAggregateOps.cpp.

Function Documentation

◆ extractElementAt()

Attribute extractElementAt ( Attribute attr,
size_t index )
static

Extracts the element at the given index from an attribute.

For ElementsAttr, returns the element at the specified index, or nullptr if the shaped type does not have rank 1. For ArrayAttr, returns the element at the specified index. For ZeroAttr, UndefAttr, and PoisonAttr, returns the attribute itself unchanged. Returns nullptr if the attribute is not one of these types or if the index is out of bounds.

Definition at line 85 of file LLVMAggregateOps.cpp.

◆ getInsertExtractValueElementType() [1/2]

Type getInsertExtractValueElementType ( function_ref< InFlightDiagnostic(StringRef)> emitError,
Type containerType,
ArrayRef< int64_t > position )
static

Extract the type at position in the LLVM IR aggregate type containerType.

Each element of position is an index into a nested aggregate type. Return the resulting type or emit an error.

Definition at line 31 of file LLVMAggregateOps.cpp.

References mlir::emitError(), and mlir::LLVM::isCompatibleType().

Referenced by mlir::LLVM::parseInsertExtractValueElementType().

◆ getInsertExtractValueElementType() [2/2]

Type getInsertExtractValueElementType ( Type llvmType,
ArrayRef< int64_t > position )
static

Extract the type at position in the wrapped LLVM IR aggregate type containerType.

Definition at line 68 of file LLVMAggregateOps.cpp.