MLIR
15.0.0git
|
A struct to manage the tile loop nest specific information. More...
#include "mlir/Dialect/Linalg/Utils/Utils.h"
Public Member Functions | |
TileLoopNest (LinalgOp rootOp) | |
LogicalResult | tileRootOp (OpBuilder &b, ArrayRef< int64_t > tileSizes, ArrayRef< int64_t > tileInterchange, Optional< LinalgLoopDistributionOptions > tileDistribution) |
Tile the root operation using the given tileSizes and tileInterchange , and tileDistribution . More... | |
FailureOr< LinalgOp > | fuseProducer (OpBuilder &b, OpOperand *consumerOpOperand) |
Fuse the producer of consumerOpOperand into the tile loop nest. More... | |
ValueRange | getRootOpReplacementResults () |
Returns the replacement results for the original untiled root operation. More... | |
LinalgOp | getRootOp () |
Returns the tiled root operation. More... | |
SmallVector< LinalgOp > | getAllTiledAndFusedOps () |
Returns the tiled root operation and the fused producers. More... | |
ArrayRef< scf::ForOp > | getLoopOps () |
Returns the loop ops generated from tiling. More... | |
bool | isEmpty () |
Returns true if the tile loop nest has no tile loops. More... | |
|
inline |
Fuse the producer of consumerOpOperand
into the tile loop nest.
Returns the fused producer or fails if fusion is not possible.
Definition at line 328 of file FusionOnTensors.cpp.
References mlir::OpBuilder::create(), mlir::Value::dyn_cast(), mlir::failure(), mlir::IROperand< DerivedT, IRValueT >::get(), mlir::Value::getDefiningOp(), mlir::detail::IROperandBase::getOwner(), mlir::Operation::getResult(), getTiledProducer(), getTiledProducerLoops(), getTiledSliceDims(), mlir::Value::getType(), mlir::Value::getUses(), isEmpty(), mlir::Value::replaceAllUsesExcept(), and mlir::OpBuilder::setInsertionPointAfter().
Referenced by mlir::linalg::tileConsumerAndFuseProducers().
SmallVector< LinalgOp > TileLoopNest::getAllTiledAndFusedOps | ( | ) |
Returns the tiled root operation and the fused producers.
Definition at line 409 of file FusionOnTensors.cpp.
|
inline |
Returns the loop ops generated from tiling.
Definition at line 362 of file Utils.h.
References mlir::linalg::tileConsumerAndFuseProducers().
|
inline |
Returns the tiled root operation.
Definition at line 356 of file Utils.h.
Referenced by mlir::linalg::tileConsumerAndFuseProducers().
ValueRange TileLoopNest::getRootOpReplacementResults | ( | ) |
Returns the replacement results for the original untiled root operation.
Definition at line 404 of file FusionOnTensors.cpp.
References isEmpty().
bool TileLoopNest::isEmpty | ( | ) |
Returns true if the tile loop nest has no tile loops.
Definition at line 198 of file FusionOnTensors.cpp.
References mlir::Value::dyn_cast(), mlir::IROperand< DerivedT, IRValueT >::get(), mlir::getBackwardSlice(), mlir::BlockArgument::getOwner(), mlir::Block::getParentOp(), mlir::Operation::getParentOp(), mlir::Value::getUsers(), and mlir::Value::hasOneUse().
Referenced by fuseProducer(), getRootOpReplacementResults(), mlir::linalg::tileConsumerAndFuseProducers(), and tileRootOp().
LogicalResult TileLoopNest::tileRootOp | ( | OpBuilder & | b, |
ArrayRef< int64_t > | tileSizes, | ||
ArrayRef< int64_t > | tileInterchange, | ||
Optional< LinalgLoopDistributionOptions > | tileDistribution | ||
) |
Tile the root operation using the given tileSizes
and tileInterchange
, and tileDistribution
.
Definition at line 275 of file FusionOnTensors.cpp.
References mlir::detail::enumerate(), mlir::failed(), mlir::failure(), isEmpty(), mlir::linalg::Loops, mlir::linalg::LinalgTilingOptions::setDistributionOptions(), mlir::linalg::LinalgTilingOptions::setInterchange(), mlir::linalg::LinalgTilingOptions::setLoopType(), mlir::linalg::LinalgTilingOptions::setTileSizes(), mlir::success(), and mlir::linalg::tileLinalgOp().
Referenced by mlir::linalg::tileConsumerAndFuseProducers().