MLIR
15.0.0git
|
#include "PassDetail.h"
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
#include "mlir/Dialect/Complex/IR/Complex.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/Passes.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Dialect/Linalg/Utils/Utils.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineExprVisitor.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/Support/LLVM.h"
#include "mlir/Transforms/FoldUtils.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "linalg-promotion" |
Functions | |
static Value | allocBuffer (ImplicitLocOpBuilder &b, const LinalgPromotionOptions &options, Type elementType, Value allocSize, DataLayout &layout, Optional< unsigned > alignment=None) |
Alloc a new buffer of size * width i8; where width is given by the data layout for elementType . More... | |
static Optional< Value > | defaultAllocBufferCallBack (const LinalgPromotionOptions &options, OpBuilder &builder, memref::SubViewOp subView, ArrayRef< Value > boundingSubViewSize, Optional< unsigned > alignment, DataLayout &layout) |
Default allocation callback function. More... | |
static LogicalResult | defaultDeallocBufferCallBack (const LinalgPromotionOptions &options, OpBuilder &b, Value fullLocalView) |
Default implementation of deallocation of the buffer use for promotion. More... | |
static FailureOr< MapVector< int64_t, PromotionInfo > > | promoteSubViews (ImplicitLocOpBuilder &b, LinalgOpInstancePromotionOptions options, DataLayout &layout) |
static FailureOr< LinalgOp > | promoteSubViews (ImplicitLocOpBuilder &b, LinalgOp op, LinalgOpInstancePromotionOptions options, DataLayout &layout) |
#define DEBUG_TYPE "linalg-promotion" |
Definition at line 39 of file Promotion.cpp.
|
static |
Alloc a new buffer of size
* width
i8; where width
is given by the data layout
for elementType
.
Use AllocOp or AllocaOp depending on options
. Take an optional alignment.
Definition at line 45 of file Promotion.cpp.
References mlir::ImplicitLocOpBuilder::create(), mlir::ImplicitLocOpBuilder::createOrFold(), mlir::Value::getDefiningOp(), mlir::Builder::getI64IntegerAttr(), mlir::Builder::getIntegerType(), mlir::DataLayout::getTypeSize(), and mlir::linalg::LinalgPromotionOptions::useAlloca.
Referenced by defaultAllocBufferCallBack().
|
static |
Default allocation callback function.
This allocates a promoted buffer when no call back to do so is provided. The default is to allocate a memref<..xi8> and return a view to get a memref type of shape boundingSubViewSize.
Definition at line 81 of file Promotion.cpp.
References allocBuffer(), mlir::ImplicitLocOpBuilder::createOrFold(), and mlir::detail::enumerate().
Referenced by defaultDeallocBufferCallBack().
|
static |
Default implementation of deallocation of the buffer use for promotion.
It expects to get the same value that the default allocation method returned, i.e. result of a ViewOp.
Definition at line 107 of file Promotion.cpp.
References mlir::linalg::LinalgPromotionOptions::alignment, mlir::linalg::LinalgPromotionOptions::allocationFn, mlir::linalg::LinalgPromotionOptions::copyInFn, mlir::linalg::LinalgPromotionOptions::copyOutFn, mlir::OpBuilder::create(), mlir::linalg::LinalgPromotionOptions::deallocationFn, defaultAllocBufferCallBack(), mlir::linalg::LinalgPromotionOptions::dynamicBuffers, mlir::Value::getDefiningOp(), mlir::linalg::LinalgPromotionOptions::operandsToPromote, options, mlir::success(), mlir::linalg::LinalgPromotionOptions::useAlloca, mlir::linalg::LinalgPromotionOptions::useFullTileBuffers, and mlir::linalg::LinalgPromotionOptions::useFullTileBuffersDefault.
|
static |
Definition at line 256 of file Promotion.cpp.
References mlir::ImplicitLocOpBuilder::create(), mlir::failed(), mlir::failure(), mlir::ImplicitLocOpBuilder::getLoc(), and mlir::linalg::promoteSubviewAsNewBuffer().
|
static |
Definition at line 312 of file Promotion.cpp.
References mlir::failed(), mlir::failure(), mlir::linalg::promoteSubViews(), and mlir::OpBuilder::setInsertionPointAfter().