MLIR  20.0.0git
Typedefs | Functions
ExtractSliceFromReshapeUtils.cpp File Reference
#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"

Go to the source code of this file.

Typedefs

using DimAndIndex = std::tuple< unsigned, Value >
 A tuple that represents (dimension number, dimension value). More...
 

Functions

static DimAndIndex invertSliceIndexing (OpBuilder &b, Location loc, ArrayRef< Range > sliceParams, const DimAndIndex &dimAndIndex)
 Transform dimAndIndex from the output index space of a (non-rank-reducing) slice described by sliceParams into the input index space. More...
 
static ValueRange invertCollapseShapeIndexing (OpBuilder &b, Location loc, ArrayRef< ReassociationIndices > reassociation, ArrayRef< OpFoldResult > reshapeSourceShape, const DimAndIndex &dimAndIndex)
 Transform dimAndIndex from the result tensor index space of a CollapseShapeOp to the source tensor index space. More...
 

Typedef Documentation

◆ DimAndIndex

using DimAndIndex = std::tuple<unsigned, Value>

A tuple that represents (dimension number, dimension value).

Definition at line 30 of file ExtractSliceFromReshapeUtils.cpp.

Function Documentation

◆ invertCollapseShapeIndexing()

static ValueRange invertCollapseShapeIndexing ( OpBuilder b,
Location  loc,
ArrayRef< ReassociationIndices reassociation,
ArrayRef< OpFoldResult reshapeSourceShape,
const DimAndIndex dimAndIndex 
)
static

Transform dimAndIndex from the result tensor index space of a CollapseShapeOp to the source tensor index space.

Definition at line 50 of file ExtractSliceFromReshapeUtils.cpp.

References mlir::OpBuilder::create(), and mlir::Operation::getResults().

Referenced by mlir::tensor::ExtractSliceFromCollapseHelper::emitLoopNestBody().

◆ invertSliceIndexing()

static DimAndIndex invertSliceIndexing ( OpBuilder b,
Location  loc,
ArrayRef< Range sliceParams,
const DimAndIndex dimAndIndex 
)
static

Transform dimAndIndex from the output index space of a (non-rank-reducing) slice described by sliceParams into the input index space.

Definition at line 34 of file ExtractSliceFromReshapeUtils.cpp.

References mlir::bindDims(), mlir::bindSymbols(), mlir::Builder::getContext(), and mlir::affine::makeComposedAffineApply().

Referenced by mlir::tensor::ExtractSliceFromCollapseHelper::emitLoopNestBody().