#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Tensor/Transforms/TransformUtils.h"
#include "mlir/Dialect/Tensor/Transforms/Transforms.h"
#include "mlir/Dialect/Utils/ReshapeOpsUtils.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/OpDefinition.h"
#include "llvm/ADT/STLExtras.h"
usingnamespacemlir;
usingnamespacemlir::affine;
usingnamespacemlir::tensor;
DimAndIndex;
static DimAndIndex invertSliceIndexing(OpBuilder &b, Location loc,
ArrayRef<Range> sliceParams,
const DimAndIndex &dimAndIndex) { … }
static ValueRange invertCollapseShapeIndexing(
OpBuilder &b, Location loc, ArrayRef<ReassociationIndices> reassociation,
ArrayRef<OpFoldResult> reshapeSourceShape, const DimAndIndex &dimAndIndex) { … }
FailureOr<ExtractSliceFromCollapseHelper>
tensor::ExtractSliceFromCollapseHelper::create(
OpBuilder &b, tensor::CollapseShapeOp collapseOp,
tensor::ExtractSliceOp extractOp) { … }
FailureOr<ExtractSliceFromCollapseHelper>
tensor::ExtractSliceFromCollapseHelper::create(OpBuilder &b,
tensor::CollapseShapeOp op,
ArrayRef<Range> sliceParams) { … }
std::pair<Value, SmallVector<Range>>
tensor::ExtractSliceFromCollapseHelper::emitLoopNestBody(
OpBuilder &builder, Location loc, ValueRange tileInductionVars) { … }
FailureOr<Operation *>
tensor::simplifyCollapseShapeWithRankReducingExtractSlice(
tensor::CollapseShapeOp op, RewriterBase &rewriter) { … }