MLIR  16.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/FunctionInterfaces.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/TensorEncoding.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"
+ Include dependency graph for BuiltinTypes.cpp:

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 AffineExpr getOffsetExpr (MemRefType memrefType)
 Return the AffineExpr representation of the offset, assuming memRefType is a strided memref. More...
 
static MemRefType makeContiguousRowMajorMemRefType (MLIRContext *context, ArrayRef< int64_t > shape, Type elementType, AffineExpr offset)
 Helper to construct a contiguous MemRefType of shape, elementType and offset AffineExpr. More...
 

Macro Definition Documentation

◆ GET_TYPEDEF_CLASSES

#define GET_TYPEDEF_CLASSES

Tablegen Type Definitions.

Definition at line 33 of file BuiltinTypes.cpp.

◆ GET_TYPEDEF_LIST

#define GET_TYPEDEF_LIST

Function Documentation

◆ checkTensorElementType()

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

◆ 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 732 of file BuiltinTypes.cpp.

References mlir::Add, mlir::CeilDiv, mlir::AffineExpr::dyn_cast(), extractStridesFromTerm(), mlir::failure(), mlir::FloorDiv, mlir::Mod, mlir::Mul, mlir::succeeded(), and mlir::success().

Referenced by foldExtractStridedOpFromInsertChain(), and mlir::getStridesAndOffset().

◆ extractStridesFromTerm()

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

Definition at line 717 of file BuiltinTypes.cpp.

References mlir::AffineExpr::dyn_cast().

Referenced by extractStrides().

◆ getOffsetExpr()

static AffineExpr getOffsetExpr ( MemRefType  memrefType)
static

Return the AffineExpr representation of the offset, assuming memRefType is a strided memref.

Definition at line 1054 of file BuiltinTypes.cpp.

References mlir::failed(), and mlir::getStridesAndOffset().

Referenced by mlir::isStaticShapeAndContiguousRowMajor().

◆ makeContiguousRowMajorMemRefType()

static MemRefType makeContiguousRowMajorMemRefType ( MLIRContext context,
ArrayRef< int64_t >  shape,
Type  elementType,
AffineExpr  offset 
)
static

Helper to construct a contiguous MemRefType of shape, elementType and offset AffineExpr.

Definition at line 1064 of file BuiltinTypes.cpp.

References mlir::AffineMap::inferFromExprList(), and mlir::makeCanonicalStridedLayoutExpr().

Referenced by mlir::isStaticShapeAndContiguousRowMajor().