MLIR
21.0.0git
|
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/AsmParser/AsmParser.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Complex/IR/Complex.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/SparseTensor/IR/SparseTensor.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Tensor/Utils/Utils.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Utils/ReshapeOpsUtils.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/AffineExprVisitor.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypeInterfaces.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/LogicalResult.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <optional>
#include "mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.cpp.inc"
#include "mlir/Dialect/Linalg/IR/LinalgOps.cpp.inc"
#include "mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc"
#include "mlir/Dialect/Linalg/IR/LinalgRelayoutOps.cpp.inc"
Go to the source code of this file.
Classes | |
struct | FoldTransposeWithTranspose |
Fold transpose with transpose. More... | |
struct | SwapTransposeWithBroadcast |
This pattern canonicalize transpose by swapping the order of broadcast and transpose: transpose(broadcast(input)) -> broadcast(transpose(input)) More... | |
struct | mlir::linalg::FoldTensorCastPackOp |
Folds a tensor.cast op into a consuming PackOp op if the tensor.cast has source that is more static than the consuming op. More... | |
struct | mlir::linalg::FoldTensorCastUnPackOp |
Folds a tensor.cast op into a consuming UnPackOp op if the tensor.cast has source that is more static than the consuming op. More... | |
Namespaces | |
mlir | |
Include the generated interface declarations. | |
mlir::linalg | |
Macros | |
#define | GET_OP_CLASSES |
#define | GET_OP_CLASSES |
#define | GET_OP_CLASSES |
Typedefs | |
using | RegionBuilderFn = llvm::function_ref< void(ImplicitLocOpBuilder &, Block &, ArrayRef< NamedAttribute >)> |
Functions | |
static OpFoldResult | getDimValue (OpBuilder &builder, Location loc, Value v, int64_t dim) |
Return a memref.dim or tensor.dim for the shape of v at dim . More... | |
static Operation * | getSlice (OpBuilder &b, Location loc, Value source, ArrayRef< OpFoldResult > offsets, ArrayRef< OpFoldResult > sizes, ArrayRef< OpFoldResult > strides) |
Returns a memref.subview or a tensor.extract_slice based on the type of the source . More... | |
static void | fillStructuredOpRegion (OpBuilder &opBuilder, Region ®ion, TypeRange inputTypes, TypeRange outputTypes, ArrayRef< NamedAttribute > attrs, RegionBuilderFn regionBuilder) |
Fills the region of a structured operation using the provided regionBuilder . More... | |
static void | buildStructuredOp (OpBuilder &b, OperationState &state, std::optional< TypeRange > resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef< NamedAttribute > attributes, RegionBuilderFn regionBuilder) |
Creates a structured operation given inputs , outputs , and attributes . More... | |
static void | buildMatmulOp (OpBuilder &b, OperationState &state, std::optional< TypeRange > resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef< NamedAttribute > attributes, RegionBuilderFn regionBuilder, ArrayRef< AffineMap > indexingMaps) |
static void | buildBatchMatmulOp (OpBuilder &b, OperationState &state, std::optional< TypeRange > resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef< NamedAttribute > attributes, RegionBuilderFn regionBuilder, ArrayRef< AffineMap > indexingMaps) |
static ParseResult | parseCommonStructuredOpParts (OpAsmParser &parser, OperationState &result, SmallVectorImpl< Type > &inputTypes, SmallVectorImpl< Type > &outputTypes, bool addOperandSegmentSizes=true) |
Common parsing used for both named structured ops created by ods-gen and by manually defined C++ ops. More... | |
static void | printCommonStructuredOpParts (OpAsmPrinter &p, ValueRange inputs, ValueRange outputs) |
static ParseResult | parseNamedStructuredOpRegion (OpAsmParser &parser, Region ®ion, unsigned numRegionArgs, TypeRange inputTypes, TypeRange outputTypes, ArrayRef< NamedAttribute > attrs, RegionBuilderFn regionBuilder) |
static ParseResult | parseNamedStructuredOpResults (OpAsmParser &parser, SmallVectorImpl< Type > &resultTypes) |
static ParseResult | parseNamedStructuredOp (OpAsmParser &parser, OperationState &result, unsigned numRegionArgs, RegionBuilderFn regionBuilder) |
static void | printNamedStructuredOpResults (OpAsmPrinter &p, TypeRange resultTypes) |
static void | printNamedStructuredOp (OpAsmPrinter &p, Operation *op, ValueRange inputs, ValueRange outputs, ArrayRef< StringRef > elidedAttrs={}) |
static void | buildGenericRegion (OpBuilder &builder, Location loc, Region ®ion, ValueRange inputs, ValueRange outputs, function_ref< void(OpBuilder &, Location, ValueRange)> bodyBuild) |
static void | getGenericEffectsImpl (SmallVectorImpl< SideEffects::EffectInstance< MemoryEffects::Effect >> &effects, LinalgOp linalgOp) |
static Speculation::Speculatability | getGenericSpeculatabilityImpl (LinalgOp linalgOp) |
static ParseResult | parseDstStyleOp (OpAsmParser &parser, OperationState &result, function_ref< ParseResult(OpAsmParser &, NamedAttrList &)> parseAttrsFn=nullptr) |
static void | addBodyWithPayloadOp (OpAsmParser &parser, OperationState &result, const OperationName &payloadOpName, const NamedAttrList &payloadOpAttrs, ArrayRef< Value > operands, bool initFirst=false) |
static Operation * | findPayloadOp (Block *body, bool initFirst=false) |
void | printShortForm (OpAsmPrinter &p, Operation *payloadOp) |
static ParseResult | parseDenseI64ArrayAttr (OpAsmParser &parser, NamedAttrList &attributes, StringRef attributeName) |
static void | printDenseI64ArrayAttr (OpAsmPrinter &p, StringRef attributeName, ArrayRef< int64_t > attributeValue) |
static void | buildIdentityRegion (OpBuilder &builder, Location loc, Region ®ion, ValueRange inputs, ValueRange outputs) |
static LogicalResult | verifyYield (linalg::YieldOp op, LinalgOp linalgOp) |
static LogicalResult | appendMangledType (llvm::raw_string_ostream &ss, Type t) |
static std::tuple< SmallVector< utils::IteratorType >, SmallVector< AffineMap > > | computeIteratorTypesAndIndexingMaps (OpBuilder &builder, int64_t inputRank, int64_t dim, bool allParallel=false) |
template<typename T > | |
static Value | reduce (OpBuilder &builder, Location loc, Value input, Value output, int64_t dim) |
static Value | buildSubAndExpOp (OpBuilder &builder, Location loc, Value input, Value max, Value output, int64_t dim) |
Produce a linalg generic that computes the second step of the softmax decomposition: res = exp(input - max), where max is the max of input on dimension dim . More... | |
static Value | buildDivOp (OpBuilder &builder, Location loc, Value numerator, Value denominator, Value output, int64_t dim) |
Produce a linalg generic that computes the final step of the softmax decomposition. More... | |
static bool | areResultExprsSubsetOf (AffineMap subMap, AffineMap fullMap) |
static bool | isBroadcasted (AffineMap explictMap, AffineMap defaultMap) |
Check if the user defined map is valid broadcast map. More... | |
static LogicalResult | verifyExtendedMatmulSemantic (MatmulOp matmulOp, unsigned opIndex) |
Verifies the broadcast and transpose semantic sepecified by the explicit indexing map for the MatmulOp op for each operand specified by opIndex . More... | |
static LogicalResult | verifyInputMaps (BatchMatmulOp batchMatmulOp, AffineMap opIndexingMap, AffineMap defaultIndexingMap, bool isLHS) |
static LogicalResult | verifyOutputMap (BatchMatmulOp batchMatmulOp, AffineMap opIndexingMap) |
This function checks if the given AffineMap for the output of a BatchMatmulOp has exactly 3 result dimensions and if the output map result dimensions are valid. More... | |
static LogicalResult | verifyExtendedBatchMatmulSemantic (BatchMatmulOp batchMatmulOp, unsigned opIndex) |
Verifies the broadcast and transpose semantic specified by the explicit indexing map for the BatchMatmulOp op for each operand specified by opIndex. More... | |
FailureOr< ArrayAttr > | mlir::linalg::parseIndexingMapsAttr (OpAsmParser &parser) |
static SmallVector< OpFoldResult > | mlir::linalg::getNewMixedTileSizes (PatternRewriter &rewriter, Type newPackedTy, SmallVector< OpFoldResult > mixedTiles) |
template<typename OpTy > | |
static LogicalResult | mlir::linalg::reifyResultShapesImpl (OpTy op, OpBuilder &builder, ReifiedRankedShapedTypeDims &reifiedReturnShapes) |
template<typename OpTy > | |
static DenseMap< int64_t, OpFoldResult > | mlir::linalg::getDimAndTileMappingImpl (OpTy op) |
template<typename OpTy > | |
static SmallVector< OpFoldResult > | mlir::linalg::getMixedTilesImpl (OpTy op) |
template<typename OpTy > | |
static SmallVector< int64_t > | mlir::linalg::getStaticTilesImpl (OpTy op) |
static bool | mlir::linalg::isInvalidPackingPosSpecification (ArrayRef< int64_t > dimsPos, size_t rank) |
Returns true if dimsPos is invalid. More... | |
static bool | mlir::linalg::areAllInBound (ArrayRef< int64_t > sourceShape, ArrayRef< int64_t > limitShape) |
Returns true if the dimension of sourceShape is smaller than the dimension of the limitShape . More... | |
template<typename OpTy > | |
static LogicalResult | mlir::linalg::commonVerifierPackAndUnPackOp (OpTy packOrUnPack) |
template<typename OpTy > | |
static PackOrUnPackTransposeResult | mlir::linalg::commonPermutationOfPackAndUnPackOp (OpTy packOrUnPackOp, ArrayRef< int64_t > innerPermutation, ArrayRef< int64_t > outerPermutation) |
static SmallVector< int64_t > | mlir::linalg::asShapeWithAnyValueAsDynamic (ArrayRef< OpFoldResult > ofrs) |
Converts OpFoldResults to int64_t shape entries, unconditionally mapping all Value's to kDynamic, even if they are arith.constant values. More... | |
static SmallVector< int64_t > | mlir::linalg::getPackOpResultTypeShape (ArrayRef< int64_t > sourceShape, ArrayRef< int64_t > innerTileSizes, ArrayRef< int64_t > innerDimsPos, ArrayRef< int64_t > outerDimsPerm) |
Helper for PackOp::{getResultShape,inferPackedType}. More... | |
template<typename OpTy > | |
bool | mlir::linalg::areTilesAndTiledDimsAllConstant (OpTy op) |
Returns true if the tiles and the tiled dims are constant. More... | |
static bool | mlir::linalg::hasSameInnerOuterAttribute (PackOp packOp, UnPackOp unPackOp) |
static bool | mlir::linalg::haveSameTiles (PackOp packOp, UnPackOp unPackOp) |
static bool | mlir::linalg::paddingIsNotNeeded (PackOp op) |
Returns true if the pack op does not need a padding value. More... | |
static bool | mlir::linalg::inferStaticShape (PackOp packOp, SmallVectorImpl< int64_t > &srcShape, SmallVectorImpl< int64_t > &destShape) |
Returns true if the srcShape or destShape is different from the one in packOp and populates each with the inferred static shape. More... | |
template<typename PackOrUnpackOp > | |
static bool | mlir::linalg::isLikePadUnPad (PackOrUnpackOp packOp, RankedTensorType packedTensorType) |
static bool | mlir::linalg::inferStaticShape (UnPackOp op, SmallVectorImpl< int64_t > &srcShape, SmallVectorImpl< int64_t > &destShape) |
Returns true if the srcShape or destShape is different from the one in op and populates each with the inferred static shape. More... | |
#define GET_OP_CLASSES |
Definition at line 2293 of file LinalgOps.cpp.
#define GET_OP_CLASSES |
Definition at line 2293 of file LinalgOps.cpp.
#define GET_OP_CLASSES |
Definition at line 2293 of file LinalgOps.cpp.
using RegionBuilderFn = llvm::function_ref<void(ImplicitLocOpBuilder &, Block &, ArrayRef<NamedAttribute>)> |
Definition at line 118 of file LinalgOps.cpp.
|
static |
Definition at line 1408 of file LinalgOps.cpp.
References mlir::Block::addArgument(), mlir::OperationState::addRegion(), mlir::OpBuilder::create(), mlir::Region::emplaceBlock(), mlir::Block::getArguments(), mlir::AsmParser::getContext(), mlir::Operation::getResults(), mlir::Builder::getStringAttr(), mlir::OperationName::getStringRef(), mlir::Value::getType(), mlir::Builder::getUnknownLoc(), mlir::OperationState::location, and mlir::OpBuilder::setInsertionPointToStart().
|
static |
Definition at line 2324 of file LinalgOps.cpp.
References mlir::Type::isSignlessIntOrIndexOrFloat().
Referenced by mlir::linalg::generateLibraryCallName().
Definition at line 3422 of file LinalgOps.cpp.
References mlir::AffineMap::getResults().
Referenced by verifyExtendedMatmulSemantic(), and verifyInputMaps().
|
static |
Definition at line 204 of file LinalgOps.cpp.
|
static |
Produce a linalg generic that computes the final step of the softmax decomposition.
numerator
, denominator
) outs(output
) { yield n / d } Definition at line 2856 of file LinalgOps.cpp.
References computeIteratorTypesAndIndexingMaps(), mlir::OpBuilder::create(), mlir::Operation::getResult(), and mlir::Value::getType().
|
static |
Definition at line 987 of file LinalgOps.cpp.
References mlir::OpBuilder::createBlock(), mlir::Region::end(), mlir::Block::getArguments(), and mlir::getElementTypeOrSelf().
Referenced by buildIdentityRegion().
|
static |
Definition at line 1852 of file LinalgOps.cpp.
References buildGenericRegion(), and mlir::OpBuilder::create().
|
static |
Definition at line 188 of file LinalgOps.cpp.
|
static |
Creates a structured operation given inputs
, outputs
, and attributes
.
The result types are derived automatically if resultTensorTypes
is none. The body of the operation is filled using regionBuilder
. All ods-gen created structured operations use the method to implement their builders.
Definition at line 160 of file LinalgOps.cpp.
|
static |
Produce a linalg generic that computes the second step of the softmax decomposition: res = exp(input - max), where max
is the max of input
on dimension dim
.
Definition at line 2830 of file LinalgOps.cpp.
References computeIteratorTypesAndIndexingMaps(), mlir::OpBuilder::create(), mlir::Operation::getResult(), mlir::Value::getType(), and max().
|
static |
Definition at line 2785 of file LinalgOps.cpp.
References mlir::AffineMap::get(), mlir::getAffineDimExpr(), mlir::Builder::getContext(), and mlir::AffineMap::getMultiDimIdentityMap().
Referenced by buildDivOp(), buildSubAndExpOp(), and reduce().
|
static |
Fills the region of a structured operation using the provided regionBuilder
.
The method is used by both named structured ops created by ods-gen and by manually defined C++ ops. It is called by both builders and parsers and creates a block with arguments corresponding to the elemental types of inputTypes
and outputTypes
.
Definition at line 126 of file LinalgOps.cpp.
References mlir::OpBuilder::createBlock(), mlir::getElementTypeOrSelf(), mlir::Builder::getUnknownLoc(), and mlir::OpBuilder::setInsertionPointToStart().
Referenced by parseNamedStructuredOpRegion().
Definition at line 1485 of file LinalgOps.cpp.
References mlir::Block::getArgument(), mlir::Block::getArguments(), mlir::Block::getNumArguments(), mlir::Operation::getNumOperands(), mlir::Operation::getOperands(), and mlir::Block::getOperations().
|
static |
Return a memref.dim
or tensor.dim
for the shape of v
at dim
.
Definition at line 59 of file LinalgOps.cpp.
References mlir::getAsOpFoldResult(), mlir::Builder::getIndexAttr(), and mlir::Value::getType().
|
static |
Definition at line 1212 of file LinalgOps.cpp.
References mlir::detail::enumerate(), mlir::SideEffects::Effect::Base< DerivedEffect, BaseEffect >::get(), mlir::SideEffects::Resource::Base< DefaultResource >::get(), and mlir::Value::getType().
|
static |
Definition at line 1245 of file LinalgOps.cpp.
References mlir::Speculation::NotSpeculatable, and mlir::Speculation::RecursivelySpeculatable.
|
static |
Returns a memref.subview or a tensor.extract_slice based on the type of the source
.
Definition at line 77 of file LinalgOps.cpp.
References mlir::OpBuilder::create(), and mlir::Value::getType().
Check if the user defined map is valid broadcast map.
Here broadcast indexing maps are defined in context of corresponding default indexing maps for the given Op. This way the check becomes very simple i.e just check the number of result dims. Returns true if the explictMap is broadcasted with respect to the defaultMap.
Definition at line 3437 of file LinalgOps.cpp.
References mlir::AffineMap::getNumResults().
Referenced by verifyExtendedMatmulSemantic(), and verifyInputMaps().
|
static |
Common parsing used for both named structured ops created by ods-gen and by manually defined C++ ops.
Does not handle regions.
Definition at line 224 of file LinalgOps.cpp.
References mlir::OperationState::addAttribute(), mlir::NamedAttrList::append(), mlir::OperationState::attributes, mlir::AsmParser::getBuilder(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), mlir::Builder::getDenseI32ArrayAttr(), mlir::NamedAttrList::getDictionary(), mlir::OperationName::getRegisteredInfo(), mlir::OperationState::name, mlir::OperationState::operands, mlir::AsmParser::parseAttribute(), mlir::AsmParser::parseColonTypeList(), mlir::AsmParser::parseGreater(), mlir::AsmParser::parseLParen(), mlir::OpAsmParser::parseOperandList(), mlir::AsmParser::parseOptionalAttrDict(), mlir::AsmParser::parseOptionalKeyword(), mlir::AsmParser::parseOptionalLess(), mlir::AsmParser::parseRParen(), mlir::OperationState::propertiesAttr, and mlir::OpAsmParser::resolveOperands().
Referenced by parseDstStyleOp(), and parseNamedStructuredOp().
|
static |
Definition at line 1685 of file LinalgOps.cpp.
References mlir::detail::DenseArrayAttrImpl< T >::parse(), mlir::AsmParser::parseEqual(), mlir::AsmParser::parseKeyword(), and mlir::NamedAttrList::set().
|
static |
Definition at line 1354 of file LinalgOps.cpp.
References mlir::OperationState::addTypes(), mlir::OperationState::attributes, parseCommonStructuredOpParts(), and mlir::AsmParser::parseOptionalAttrDict().
|
static |
Definition at line 336 of file LinalgOps.cpp.
References mlir::OperationState::addRegion(), mlir::OperationState::addTypes(), mlir::OperationState::attributes, mlir::NamedAttrList::getAttrs(), parseCommonStructuredOpParts(), parseNamedStructuredOpRegion(), parseNamedStructuredOpResults(), and mlir::AsmParser::parseOptionalAttrDict().
|
static |
Definition at line 310 of file LinalgOps.cpp.
References mlir::AsmParser::emitError(), fillStructuredOpRegion(), mlir::AsmParser::getContext(), and mlir::AsmParser::getCurrentLocation().
Referenced by parseNamedStructuredOp().
|
static |
Definition at line 329 of file LinalgOps.cpp.
References mlir::AsmParser::parseOptionalArrowTypeList().
Referenced by parseNamedStructuredOp().
|
static |
Definition at line 298 of file LinalgOps.cpp.
References mlir::ValueRange::getTypes().
|
static |
Definition at line 1733 of file LinalgOps.cpp.
|
static |
Definition at line 373 of file LinalgOps.cpp.
|
static |
Definition at line 366 of file LinalgOps.cpp.
References mlir::AsmPrinter::printOptionalArrowTypeList().
void printShortForm | ( | OpAsmPrinter & | p, |
Operation * | payloadOp | ||
) |
Definition at line 1514 of file LinalgOps.cpp.
References mlir::Operation::getAttrs(), mlir::Operation::getName(), mlir::OperationName::getStringRef(), and mlir::OpAsmPrinter::printOptionalAttrDict().
|
static |
Definition at line 2807 of file LinalgOps.cpp.
References computeIteratorTypesAndIndexingMaps(), mlir::OpBuilder::create(), mlir::Operation::getResult(), and mlir::Value::getType().
Referenced by addAtomicRMW(), createDecl(), and declareReduction().
|
static |
Verifies the broadcast and transpose semantic specified by the explicit indexing map for the BatchMatmulOp op for each operand specified by opIndex.
Definition at line 3524 of file LinalgOps.cpp.
References verifyInputMaps(), and verifyOutputMap().
|
static |
Verifies the broadcast and transpose semantic sepecified by the explicit indexing map for the MatmulOp op
for each operand specified by opIndex
.
Definition at line 3444 of file LinalgOps.cpp.
References areResultExprsSubsetOf(), and isBroadcasted().
|
static |
Definition at line 3468 of file LinalgOps.cpp.
References areResultExprsSubsetOf(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getResult(), isBroadcasted(), and mlir::AffineExpr::isFunctionOfDim().
Referenced by verifyExtendedBatchMatmulSemantic().
|
static |
This function checks if the given AffineMap for the output of a BatchMatmulOp has exactly 3 result dimensions and if the output map result dimensions are valid.
Definition at line 3501 of file LinalgOps.cpp.
References mlir::AffineMap::getNumResults().
Referenced by verifyExtendedBatchMatmulSemantic().
|
static |
Definition at line 2235 of file LinalgOps.cpp.
References mlir::IROperand< DerivedT, IRValueT >::get(), mlir::getElementTypeOrSelf(), and mlir::Value::getType().
Referenced by verifyInitLikeSingleArgRegion().
SmallVector<int64_t> innerDimsPos |
Definition at line 4275 of file LinalgOps.cpp.
Referenced by mlir::linalg::commonVerifierPackAndUnPackOp(), computePackUnPackPerm(), mlir::linalg::getPackOpResultTypeShape(), getPackUnpackRankReducedPerm(), mlir::linalg::isLikePadUnPad(), mlir::linalg::DecomposeOuterUnitDimsUnPackOpPattern::matchAndRewrite(), and vectorizeAsTensorPackOp().
SmallVector<OpFoldResult> innerTiles |
Definition at line 4276 of file LinalgOps.cpp.
Referenced by vectorizeAsTensorPackOp(), and vectorizeAsTensorUnpackOp().
SmallVector<int64_t> outerDimsPerm |
Definition at line 4277 of file LinalgOps.cpp.
Referenced by mlir::linalg::getPackOpResultTypeShape(), getPackUnpackRankReducedPerm(), vectorizeAsTensorPackOp(), and vectorizeAsTensorUnpackOp().