MLIR 22.0.0git
BlockPackMatmul.cpp File Reference
#include "mlir/Dialect/Linalg/Passes.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Dialect/Linalg/Utils/Utils.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/SmallVector.h"
#include <optional>
#include "mlir/Dialect/Linalg/Passes.h.inc"

Go to the source code of this file.

Classes

class  mlir::impl::LinalgBlockPackMatmulBase< DerivedT >

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::impl
 Attribute collections provide a dictionary-like interface.

Macros

#define GEN_PASS_DEF_LINALGBLOCKPACKMATMUL

Functions

std::unique_ptr<::mlir::Passmlir::impl::createLinalgBlockPackMatmul ()
std::unique_ptr<::mlir::Passmlir::impl::createLinalgBlockPackMatmul (LinalgBlockPackMatmulOptions options)
std::unique_ptr<::mlir::Passmlir::createLinalgBlockPackMatmul ()
std::unique_ptr<::mlir::Passmlir::createLinalgBlockPackMatmul (LinalgBlockPackMatmulOptions options)
static std::optional< int64_tgetConstantRange (const Range &range)
 Return constant range span or nullopt, otherwise.
static bool validateFullTilesOnDims (linalg::LinalgOp linalgOp, ArrayRef< OpFoldResult > tiles, ArrayRef< int64_t > dims)
 Return true if all dimensions are fully divisible by the respective tiles.
static FailureOr< PackTransposeResulttransposePackedMatmul (RewriterBase &rewriter, linalg::LinalgOp linalgOp, linalg::PackOp packOp, AffineMap operandMap, ArrayRef< unsigned > blocksStartDimPos, bool transposeOuterBlocks, bool transposeInnerBlocks)
 Return failure or packed matmul with one of its operands transposed.

Macro Definition Documentation

◆ GEN_PASS_DEF_LINALGBLOCKPACKMATMUL

#define GEN_PASS_DEF_LINALGBLOCKPACKMATMUL

Definition at line 21 of file BlockPackMatmul.cpp.

Function Documentation

◆ getConstantRange()

std::optional< int64_t > getConstantRange ( const Range & range)
static

Return constant range span or nullopt, otherwise.

Definition at line 29 of file BlockPackMatmul.cpp.

References mlir::getConstantIntValue(), mlir::Range::offset, mlir::Range::size, and mlir::Range::stride.

Referenced by validateFullTilesOnDims().

◆ transposePackedMatmul()

FailureOr< PackTransposeResult > transposePackedMatmul ( RewriterBase & rewriter,
linalg::LinalgOp linalgOp,
linalg::PackOp packOp,
AffineMap operandMap,
ArrayRef< unsigned > blocksStartDimPos,
bool transposeOuterBlocks,
bool transposeInnerBlocks )
static

Return failure or packed matmul with one of its operands transposed.

Definition at line 89 of file BlockPackMatmul.cpp.

References mlir::AffineMap::getDimPosition(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumResults(), and mlir::linalg::packTranspose().

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

◆ validateFullTilesOnDims()

bool validateFullTilesOnDims ( linalg::LinalgOp linalgOp,
ArrayRef< OpFoldResult > tiles,
ArrayRef< int64_t > dims )
static

Return true if all dimensions are fully divisible by the respective tiles.

Definition at line 43 of file BlockPackMatmul.cpp.

References mlir::getConstantIntValue(), getConstantRange(), and mlir::linalg::inferContractionDims().

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