MLIR
16.0.0git
|
#include "mlir/Dialect/SCF/Transforms/TileUsingInterface.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
#include "mlir/Dialect/Arithmetic/Utils/Utils.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/SCF/Utils/Utils.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Interfaces/TilingInterface.h"
#include "llvm/Support/Debug.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "tile-using-interface" |
Functions | |
static SmallVector< unsigned > | fillInterchangeVector (ArrayRef< unsigned > interchangeVector, size_t iterationDomainSize) |
Helper method to adjust the interchange vector to match the iteration domain. More... | |
template<typename T > | |
static SmallVector< T > | applyPermutationToVector (const SmallVector< T > &vector, ArrayRef< unsigned > interchange) |
Helper method to apply permutation to a vector. More... | |
static SmallVector< unsigned > | invertPermutationVector (ArrayRef< unsigned > interchange) |
Helper method to apply to invert a permutation. More... | |
static bool | isPermutation (ArrayRef< unsigned > interchange) |
Method to check if an interchange vector is a permutation. More... | |
static bool | tileDividesIterationDomain (Range loopRange) |
static SmallVector< scf::ForOp > | generateTileLoopNest (OpBuilder &builder, Location loc, ArrayRef< Range > loopRanges, ArrayRef< Value > tileSizeVals, SmallVector< OpFoldResult > &offsets, SmallVector< OpFoldResult > &sizes) |
Generate an empty loop nest that represents the tiled loop nest shell. More... | |
static Optional< OpResult > | getFusableProducer (Value v) |
Return the Value that is defined by an operation that implements the TilingInterface . More... | |
static void | replaceIterArgs (scf::ForOp outerFor, scf::ForOp innerFor, PatternRewriter &rewriter) |
#define DEBUG_TYPE "tile-using-interface" |
Definition at line 26 of file TileUsingInterface.cpp.
|
static |
Helper method to apply permutation to a vector.
Definition at line 63 of file TileUsingInterface.cpp.
|
static |
Helper method to adjust the interchange vector to match the iteration domain.
Definition at line 49 of file TileUsingInterface.cpp.
Referenced by mlir::scf::TileUsingSCFForOp::returningMatchAndRewrite().
|
static |
Generate an empty loop nest that represents the tiled loop nest shell.
loopRanges
specifies the lb, ub and step of the untiled iteration space.tileSizeVals
is the tile sizes to use. Zero represent untiled loops.offsets
and sizes
return the multi-dimensional offset and size of the tile processed within the inner most loop. Definition at line 114 of file TileUsingInterface.cpp.
References mlir::bindDims(), mlir::bindSymbols(), mlir::OpBuilder::create(), mlir::detail::enumerate(), mlir::AffineMap::get(), mlir::Builder::getContext(), mlir::getValueOrCreateConstantIndexOp(), mlir::m_Zero(), mlir::matchPattern(), mlir::Range::offset, mlir::OpBuilder::setInsertionPoint(), and tileDividesIterationDomain().
Referenced by mlir::scf::TileUsingSCFForOp::returningMatchAndRewrite().
Return the Value
that is defined by an operation that implements the TilingInterface
.
Looks through iter_args
of scf.for nest if required.
Definition at line 369 of file TileUsingInterface.cpp.
References mlir::Value::cast(), mlir::Value::dyn_cast(), and mlir::Value::getDefiningOp().
Referenced by mlir::scf::TileConsumerAndFuseProducersUsingSCFForOp::returningMatchAndRewrite().
Helper method to apply to invert a permutation.
Definition at line 71 of file TileUsingInterface.cpp.
References mlir::detail::enumerate().
Referenced by mlir::scf::TileUsingSCFForOp::returningMatchAndRewrite().
|
static |
Method to check if an interchange vector is a permutation.
Definition at line 79 of file TileUsingInterface.cpp.
Referenced by mlir::scf::TileUsingSCFForOp::returningMatchAndRewrite().
|
static |
Definition at line 383 of file TileUsingInterface.cpp.
References mlir::Operation::getBlock(), mlir::detail::IROperandBase::getOwner(), and mlir::Value::replaceUsesWithIf().
Referenced by mlir::scf::TileConsumerAndFuseProducersUsingSCFForOp::returningMatchAndRewrite().
|
static |
Definition at line 94 of file TileUsingInterface.cpp.
References mlir::getConstantIntValue(), mlir::Range::offset, mlir::Range::size, and mlir::Range::stride.
Referenced by generateTileLoopNest().