MLIR 22.0.0git
ExtractSliceFromReshapeUtils.cpp File Reference

Go to the source code of this file.

Typedefs

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

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.
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.

Typedef Documentation

◆ DimAndIndex

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

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

Definition at line 28 of file ExtractSliceFromReshapeUtils.cpp.

Function Documentation

◆ invertCollapseShapeIndexing()

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 48 of file ExtractSliceFromReshapeUtils.cpp.

References b.

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

◆ invertSliceIndexing()

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 32 of file ExtractSliceFromReshapeUtils.cpp.

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

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