MLIR 22.0.0git
PadTilingInterface.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "pad-tiling-interface"
#define DBGS()
#define DBGSNL()

Functions

static SmallVector< OpFoldResultgetFullRankPaddingSizes (Builder &b, ArrayRef< OpFoldResult > indexingSizes, const PadTilingInterfaceOptions &options)
 Form a "full-rank" padding specification so that the application is easy.
static int64_t extractConstantMultiplier (AffineExpr expr)
 Extracts the constant multiplier from an affine expression of the form d * c or c * d, where d is an AffineDimExpr and c is an AffineConstantExpr.
static Value padOperand (OpBuilder &builder, TilingInterface opToPad, TypedValue< RankedTensorType > v, ArrayRef< OpFoldResult > paddedShape, Attribute paddingValueAttr)
 Pad a single operand to paddedShape using paddingValueAttr as padding Value.

Macro Definition Documentation

◆ DBGS

#define DBGS ( )
Value:
(llvm::dbgs() << "[" DEBUG_TYPE << "]: ")
#define DEBUG_TYPE

Definition at line 32 of file PadTilingInterface.cpp.

Referenced by mlir::linalg::computePaddedShape(), getFullRankPaddingSizes(), padOperand(), and mlir::linalg::rewriteAsPaddedOp().

◆ DBGSNL

#define DBGSNL ( )
Value:
(llvm::dbgs() << "\n")

Definition at line 33 of file PadTilingInterface.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "pad-tiling-interface"

Definition at line 26 of file PadTilingInterface.cpp.

Function Documentation

◆ extractConstantMultiplier()

int64_t extractConstantMultiplier ( AffineExpr expr)
static

Extracts the constant multiplier from an affine expression of the form d * c or c * d, where d is an AffineDimExpr and c is an AffineConstantExpr.

Returns 1 if the expression is not a simple multiplication of a dimension and a constant.

Definition at line 63 of file PadTilingInterface.cpp.

References mlir::Mul.

Referenced by mlir::linalg::computePaddedShape().

◆ getFullRankPaddingSizes()

SmallVector< OpFoldResult > getFullRankPaddingSizes ( Builder & b,
ArrayRef< OpFoldResult > indexingSizes,
const PadTilingInterfaceOptions & options )
static

Form a "full-rank" padding specification so that the application is easy.

Definition at line 37 of file PadTilingInterface.cpp.

References b, DBGS, mlir::isZeroInteger(), and options.

Referenced by mlir::linalg::computePaddedShape().

◆ padOperand()

Value padOperand ( OpBuilder & builder,
TilingInterface opToPad,
TypedValue< RankedTensorType > v,
ArrayRef< OpFoldResult > paddedShape,
Attribute paddingValueAttr )
static

Pad a single operand to paddedShape using paddingValueAttr as padding Value.

Definition at line 227 of file PadTilingInterface.cpp.

References DBGS, mlir::getConstantIntValue(), mlir::getElementTypeOrSelf(), and mlir::linalg::makeComposedPadHighOp().

Referenced by mlir::linalg::rewriteAsPaddedOp().