#include "mlir/Dialect/Tensor/IR/TensorTilingInterfaceImpl.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/Utils.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/Utils/Utils.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Tensor/Utils/Utils.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Interfaces/TilingInterface.h"
#include "mlir/Interfaces/ValueBoundsOpInterface.h"
usingnamespacemlir;
usingnamespacemlir::tensor;
namespace {
struct PadOpTiling : public TilingInterface::ExternalModel<PadOpTiling, PadOp> { … };
template <typename OpTy>
static SmallVector<Range> getPackUnPackIterationDomain(OpTy op,
OpBuilder &builder) { … }
static void applyPermToRange(SmallVector<OpFoldResult> &offsets,
SmallVector<OpFoldResult> &sizes,
ArrayRef<int64_t> permutation) { … }
struct PackOpTiling
: public TilingInterface::ExternalModel<PackOpTiling, PackOp> { … };
struct UnpackTileDimInfo { … };
static UnpackTileDimInfo getUnpackTileDimInfo(OpBuilder &b, UnPackOp unpackOp,
int64_t tileDim,
OpFoldResult tileOffset,
OpFoldResult tileSize) { … }
struct UnPackOpTiling
: public TilingInterface::ExternalModel<UnPackOpTiling, UnPackOp> { … };
}
FailureOr<TilingResult> tensor::bubbleUpPadSlice(OpBuilder &b,
tensor::PadOp padOp,
ArrayRef<OpFoldResult> offsets,
ArrayRef<OpFoldResult> sizes,
bool generateZeroSliceGuard) { … }
void mlir::tensor::registerTilingInterfaceExternalModels(
DialectRegistry ®istry) { … }
void mlir::tensor::registerTilingInterfaceExternalModelsForPackUnPackOps(
DialectRegistry ®istry) { … }