MLIR  20.0.0git
Macros | Functions
BuiltinTypes.cpp File Reference
#include "mlir/IR/BuiltinTypes.h"
#include "TypeDetail.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/TensorEncoding.h"
#include "mlir/IR/TypeUtilities.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/TypeSwitch.h"
#include "mlir/IR/BuiltinTypes.cpp.inc"

Go to the source code of this file.

Macros

#define GET_TYPEDEF_CLASSES
 Tablegen Type Definitions. More...
 
#define GET_TYPEDEF_LIST
 

Functions

static LogicalResult checkTensorElementType (function_ref< InFlightDiagnostic()> emitError, Type elementType)
 
static void extractStridesFromTerm (AffineExpr e, AffineExpr multiplicativeFactor, MutableArrayRef< AffineExpr > strides, AffineExpr &offset)
 
static LogicalResult extractStrides (AffineExpr e, AffineExpr multiplicativeFactor, MutableArrayRef< AffineExpr > strides, AffineExpr &offset)
 Takes a single AffineExpr e and populates the strides array with the strides expressions for each dim position. More...
 
static LogicalResult getStridesAndOffset (MemRefType t, SmallVectorImpl< AffineExpr > &strides, AffineExpr &offset)
 A stride specification is a list of integer values that are either static or dynamic (encoded with ShapedType::kDynamic). More...
 

Macro Definition Documentation

◆ GET_TYPEDEF_CLASSES

#define GET_TYPEDEF_CLASSES

Tablegen Type Definitions.

Definition at line 32 of file BuiltinTypes.cpp.

◆ GET_TYPEDEF_LIST

#define GET_TYPEDEF_LIST

Function Documentation

◆ checkTensorElementType()

static LogicalResult checkTensorElementType ( function_ref< InFlightDiagnostic()>  emitError,
Type  elementType 
)
static

Definition at line 312 of file BuiltinTypes.cpp.

References mlir::emitError(), and mlir::TensorType::isValidElementType().

◆ extractStrides()

static LogicalResult extractStrides ( AffineExpr  e,
AffineExpr  multiplicativeFactor,
MutableArrayRef< AffineExpr strides,
AffineExpr offset 
)
static

Takes a single AffineExpr e and populates the strides array with the strides expressions for each dim position.

The convention is that the strides for dimensions d0, .. dn appear in order to make indexing intuitive into the result.

Definition at line 695 of file BuiltinTypes.cpp.

References mlir::Add, mlir::CeilDiv, extractStridesFromTerm(), mlir::FloorDiv, mlir::Mod, and mlir::Mul.

◆ extractStridesFromTerm()

static void extractStridesFromTerm ( AffineExpr  e,
AffineExpr  multiplicativeFactor,
MutableArrayRef< AffineExpr strides,
AffineExpr offset 
)
static

Definition at line 680 of file BuiltinTypes.cpp.

Referenced by extractStrides().

◆ getStridesAndOffset()

static LogicalResult getStridesAndOffset ( MemRefType  t,
SmallVectorImpl< AffineExpr > &  strides,
AffineExpr offset 
)
static

A stride specification is a list of integer values that are either static or dynamic (encoded with ShapedType::kDynamic).

Strides encode the distance in the number of elements between successive entries along a particular dimension.

For example, memref<42x16xf32, (64 * d0 + d1)> specifies a view into a non-contiguous memory region of 42 by 16 f32 elements in which the distance between two consecutive elements along the outer dimension is 1 and the distance between two consecutive elements along the inner dimension is 64.

The convention is that the strides for dimensions d0, .. dn appear in order to make indexing intuitive into the result.

Definition at line 752 of file BuiltinTypes.cpp.