MLIR  15.0.0git
Macros | Functions
LinalgTransformOps.cpp File Reference
#include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Dialect/PDL/IR/PDL.h"
#include "mlir/Dialect/PDL/IR/PDLTypes.h"
#include "mlir/Dialect/Transform/IR/TransformDialect.h"
#include "mlir/Parser/Parser.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp.inc"
+ Include dependency graph for LinalgTransformOps.cpp:

Go to the source code of this file.

Macros

#define GET_OP_LIST
 
#define GET_OP_CLASSES
 

Functions

static SmallVector< int64_t > extractI64Array (ArrayAttr attr)
 Extracts a vector of int64_t from an array attribute. More...
 
static SmallVector< unsignedextractUIntArray (ArrayAttr attr)
 Extracts a vector of unsigned from an array attribute. More...
 
template<typename PatternTy , typename... Args>
static FailureOr< LinalgOp > tryApply (Operation *operation, Args &&...args)
 Attempts to apply the pattern specified as template argument to the given operation. More...
 
static LogicalResult applyTilingToAll (Operation *transformOp, Value target, ArrayRef< int64_t > tileSizes, transform::TransformResults &transformResults, transform::TransformState &state, function_ref< FailureOr< TiledLinalgOp >(LinalgOp)> applyFn)
 Apply a tiling transformation to all payload ops and store both the tiled operation as well as the created tile loops. More...
 
static ParseResult parseTileLikeOp (OpAsmParser &parser, OperationState &result, StringRef sizesAttrName)
 Parse a tiling-like operation that returns the tiled op as well as the created tile loops. More...
 

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 517 of file LinalgTransformOps.cpp.

◆ GET_OP_LIST

#define GET_OP_LIST

Function Documentation

◆ applyTilingToAll()

static LogicalResult applyTilingToAll ( Operation transformOp,
Value  target,
ArrayRef< int64_t >  tileSizes,
transform::TransformResults transformResults,
transform::TransformState state,
function_ref< FailureOr< TiledLinalgOp >(LinalgOp)>  applyFn 
)
static

Apply a tiling transformation to all payload ops and store both the tiled operation as well as the created tile loops.

Definition at line 101 of file LinalgTransformOps.cpp.

References mlir::Operation::emitError(), mlir::failed(), mlir::failure(), mlir::Operation::getOpResult(), mlir::transform::TransformState::getPayloadOps(), mlir::transform::TransformResults::set(), and mlir::success().

Referenced by parseTileLikeOp().

◆ extractI64Array()

static SmallVector<int64_t> extractI64Array ( ArrayAttr  attr)
static

Extracts a vector of int64_t from an array attribute.

Asserts if the attribute contains values other than integers.

Definition at line 25 of file LinalgTransformOps.cpp.

References value.

Referenced by parseTileLikeOp().

◆ extractUIntArray()

static SmallVector<unsigned> extractUIntArray ( ArrayAttr  attr)
static

Extracts a vector of unsigned from an array attribute.

Asserts if the attribute contains values other than intergers. May truncate.

Definition at line 35 of file LinalgTransformOps.cpp.

References value.

Referenced by parseTileLikeOp().

◆ parseTileLikeOp()

static ParseResult parseTileLikeOp ( OpAsmParser parser,
OperationState result,
StringRef  sizesAttrName 
)
static

Parse a tiling-like operation that returns the tiled op as well as the created tile loops.

The function counts the non-zero tile sizes to compute the number of results.

Definition at line 144 of file LinalgTransformOps.cpp.

References mlir::RewritePatternSet::add(), mlir::OperationState::addTypes(), mlir::applyPatternsAndFoldGreedily(), applyTilingToAll(), mlir::InFlightDiagnostic::attachNote(), mlir::OperationState::attributes, mlir::Attribute::cast(), mlir::DiagnosedSilenceableFailure::definiteFailure(), diag(), mlir::Attribute::dyn_cast(), mlir::AsmParser::emitError(), mlir::emitError(), mlir::extractFromI64ArrayAttr(), extractI64Array(), extractUIntArray(), mlir::failed(), mlir::failure(), mlir::NamedAttrList::get(), mlir::AsmParser::getBuilder(), mlir::AsmParser::getCurrentLocation(), mlir::getElementTypeOrSelf(), mlir::Operation::getLoc(), mlir::Attribute::getType(), mlir::Builder::getType(), mlir::Operation::hasTrait(), mlir::OperationState::name, mlir::OperationState::operands, mlir::parseAttribute(), mlir::OpAsmParser::parseOperand(), mlir::AsmParser::parseOptionalAttrDict(), mlir::linalg::populatePadOpVectorizationPatterns(), mlir::vector::populateVectorReductionToContractPatterns(), mlir::vector::populateVectorTransferPermutationMapLoweringPatterns(), print(), mlir::OpAsmPrinter::printOptionalAttrDict(), mlir::OpAsmParser::resolveOperand(), mlir::linalg::LinalgTilingPattern::returningMatchAndRewrite(), mlir::linalg::LinalgTilingOptions::scalarizeDynamicDims(), mlir::linalg::LinalgPaddingOptions::setHoistPaddings(), mlir::linalg::LinalgTilingOptions::setInterchange(), mlir::linalg::LinalgPaddingOptions::setPackPaddings(), mlir::linalg::LinalgPaddingOptions::setPaddingDimensions(), mlir::linalg::LinalgPaddingOptions::setPaddingValues(), mlir::linalg::LinalgTilingOptions::setTileSizes(), mlir::linalg::LinalgPaddingOptions::setTransposePaddings(), mlir::linalg::splitReduction(), mlir::linalg::splitReductionByScaling(), mlir::succeeded(), mlir::DiagnosedSilenceableFailure::success(), mlir::success(), mlir::linalg::LinalgTilingAndFusionOptions::tileInterchange, mlir::linalg::LinalgTilingAndFusionOptions::tileSizes, and mlir::verify().

◆ tryApply()

template<typename PatternTy , typename... Args>
static FailureOr<LinalgOp> tryApply ( Operation operation,
Args &&...  args 
)
static

Attempts to apply the pattern specified as template argument to the given operation.

The pattern is expected to have a returningMatchAndRewrite function that returns the "main" result or failure. Returns failure if the pattern failed to apply. Extra arguments are forwarded to the pattern constructor.

Definition at line 57 of file LinalgTransformOps.cpp.

References mlir::failed(), mlir::failure(), mlir::Operation::getContext(), and mlir::succeeded().