MLIR  21.0.0git
Functions
BuiltinAttributeInterfaces.cpp File Reference
#include "mlir/IR/BuiltinAttributeInterfaces.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Diagnostics.h"
#include "llvm/ADT/Sequence.h"
#include "mlir/IR/BuiltinAttributeInterfaces.cpp.inc"

Go to the source code of this file.

Functions

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 (AffineMap m, ArrayRef< int64_t > shape, 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...
 

Function Documentation

◆ 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 104 of file BuiltinAttributeInterfaces.cpp.

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

Referenced by foldExtractStridedOpFromInsertChain().

◆ extractStridesFromTerm()

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

Definition at line 89 of file BuiltinAttributeInterfaces.cpp.

Referenced by extractStrides().

◆ getStridesAndOffset()

static LogicalResult getStridesAndOffset ( AffineMap  m,
ArrayRef< int64_t >  shape,
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 161 of file BuiltinAttributeInterfaces.cpp.

Referenced by mlir::detail::getAffineMapStridesAndOffset().