|
MLIR 24.0.0git
|
#include "mlir/Dialect/Vector/IR/VectorOps.h"#include "mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h"#include "mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h"#include "mlir/Dialect/Arith/IR/Arith.h"#include "mlir/Dialect/Arith/Utils/Utils.h"#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"#include "mlir/Dialect/MemRef/IR/MemRef.h"#include "mlir/Dialect/MemRef/IR/MemoryAccessOpInterfaces.h"#include "mlir/Dialect/MemRef/Utils/MemRefUtils.h"#include "mlir/Dialect/Tensor/IR/Tensor.h"#include "mlir/Dialect/UB/IR/UBMatchers.h"#include "mlir/Dialect/Utils/IndexingUtils.h"#include "mlir/Dialect/Utils/StructuredOpsUtils.h"#include "mlir/Dialect/Utils/VerificationUtils.h"#include "mlir/IR/AffineExpr.h"#include "mlir/IR/AffineMap.h"#include "mlir/IR/Builders.h"#include "mlir/IR/BuiltinAttributes.h"#include "mlir/IR/BuiltinTypes.h"#include "mlir/IR/IRMapping.h"#include "mlir/IR/OpImplementation.h"#include "mlir/IR/PatternMatch.h"#include "mlir/IR/TypeUtilities.h"#include "mlir/IR/ValueRange.h"#include "mlir/Interfaces/SubsetOpInterface.h"#include "mlir/Interfaces/ValueBoundsOpInterface.h"#include "mlir/Interfaces/VectorInterfaces.h"#include "mlir/Support/LLVM.h"#include "mlir/Transforms/InliningUtils.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/Repeated.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/SmallVectorExtras.h"#include "llvm/ADT/StringSet.h"#include "llvm/Support/Casting.h"#include <cassert>#include <cstdint>#include <numeric>#include "mlir/Dialect/Vector/IR/VectorDialect.cpp.inc"#include "mlir/Dialect/Vector/IR/VectorEnums.cpp.inc"#include "mlir/Dialect/Vector/IR/VectorAttributes.cpp.inc"#include "mlir/Dialect/Vector/IR/VectorOps.cpp.inc"Go to the source code of this file.
Classes | |
| struct | mlir::vector::detail::BitmaskEnumStorage |
| struct | CanonicalizeContractAdd< AddOpType > |
| Return a fused vector::ContractionOp which represents a patterns such as: More... | |
| struct | ToElementsOfBroadcast |
| Canonicalize vector.to_elements(vector.broadcast(v)) where v is a vector. More... | |
| class | FromElementsToShapeCast |
| Rewrite from_elements on multiple scalar extracts as a shape_cast on a single extract. More... | |
Namespaces | |
| namespace | mlir |
| Include the generated interface declarations. | |
| namespace | mlir::vector |
| namespace | mlir::vector::detail |
Macros | |
| #define | GET_ATTRDEF_LIST |
| #define | GET_OP_LIST |
| #define | GET_ATTRDEF_CLASSES |
| #define | GET_OP_CLASSES |
Enumerations | |
| enum class | MaskFormat { AllTrue = 0 , AllFalse = 1 , Unknown = 2 } |
| Helper enum to classify mask value. More... | |
Functions | |
| static MaskFormat | getMaskFormat (Value mask) |
| Helper method to classify a mask value. | |
| static bool | isSupportedCombiningKind (CombiningKind combiningKind, Type elementType) |
| static unsigned | getEffectiveVectorRankForXferOp (ShapedType shapedType, VectorType vectorType) |
| Returns the effective rank of the vector to read/write for Xfer Ops. | |
| static bool | isSplatWriteConsistentWithMaskedRead (vector::TransferWriteOp write, vector::TransferReadOp read) |
| Check if write is of a constant splat and the masked read is padded with the same splat value – meaning it could be the same value as the initial constant splat. | |
| static LogicalResult | incSlicePosition (MutableArrayRef< int64_t > position, ArrayRef< int64_t > shape, ArrayRef< int64_t > offsets) |
| static Attribute | convertNumericAttr (Attribute attr, Type expectedType) |
| Converts numeric attributes to the expected type. | |
| static bool | verifyDimMap (VectorType lhsType, VectorType rhsType, const std::vector< std::pair< int64_t, int64_t > > &map) |
| static LogicalResult | verifyOutputShape (ContractionOp op, VectorType lhsType, VectorType rhsType, Type accType, Type resType, const std::vector< std::pair< int64_t, int64_t > > &contractingDimMap, const std::vector< std::pair< int64_t, int64_t > > &batchDimMap) |
| static std::optional< int64_t > | getOneSidedReductionDim (vector::ContractionOp *contract) |
| static int64_t | getResultIndex (AffineMap map, AffineExpr targetExpr) |
| static std::vector< std::pair< int64_t, int64_t > > | getDimPairForIterTy (ContractionOp *contract, IteratorType targetIteratorType) |
| static bool | isValidPositiveIndexOrPoison (int64_t index, int64_t poisonValue, int64_t maxIndex) |
| template<typename IntType> | |
| static SmallVector< IntType > | extractVector (ArrayAttr arrayAttr) |
| static LogicalResult | foldExtractOpFromExtractChain (ExtractOp extractOp) |
| Fold the result of chains of ExtractOp in place by simply concatenating the positions. | |
| static bool | hasZeroDimVectors (Operation *op) |
| Returns true if the operation has a 0-D vector type operand or result. | |
| static bool | isBroadcastLike (Operation *op) |
| All BroadcastOps, as well as ShapeCastOps that only prepend 1s, are considered to be 'broadcastlike'. | |
| static Value | foldExtractFromBroadcast (ExtractOp extractOp) |
| Fold extract(broadcast(X)) to either extract(X) or just X. | |
| static Value | foldExtractFromShuffle (ExtractOp extractOp) |
| Fold extractOp coming from ShuffleOp. | |
| static Value | foldExtractFromShapeCast (ExtractOp extractOp) |
| static Value | foldExtractFromExtractStrided (ExtractOp extractOp) |
| Fold an ExtractOp from ExtractStridedSliceOp. | |
| static Value | foldExtractStridedOpFromInsertChain (ExtractOp extractOp) |
| Fold extract_op fed from a chain of insertStridedSlice ops. | |
| static Value | foldScalarExtractFromFromElements (ExtractOp extractOp) |
| Try to fold the extraction of a scalar from a vector defined by vector.from_elements. | |
| template<typename OpType, typename AdaptorType> | |
| static Value | extractInsertFoldConstantOp (OpType op, AdaptorType adaptor, SmallVectorImpl< Value > &operands) |
| If the dynamic indices of extractOp or insertOp are in fact constants, then fold it. | |
| static Attribute | foldPoisonIndexInsertExtractOp (MLIRContext *context, ArrayRef< int64_t > staticPos, int64_t poisonVal) |
| Fold an insert or extract operation into an poison value when a poison index is found at any dimension of the static position. | |
| static Attribute | foldPoisonSrcExtractOp (Attribute srcAttr) |
| Fold a vector extract from is a poison source. | |
| static Attribute | foldDenseElementsAttrSrcExtractOp (ExtractOp extractOp, Attribute srcAttr) |
| Fold a vector extract extracting from a DenseElementsAttr. | |
| static void | populateFromInt64AttrArray (ArrayAttr arrayAttr, SmallVectorImpl< int64_t > &results) |
| static bool | haveSameDefiningOp (OperandRange operands, Operation *defOp) |
| Returns true if all the operands are defined by defOp. | |
| static LogicalResult | foldToElementsFromElements (ToElementsOp toElementsOp, SmallVectorImpl< OpFoldResult > &results) |
| Folds vector.to_elements(vector.from_elements(e0, e1, ...)) into (e0, e1, ...). | |
| static LogicalResult | foldToElementsOfBroadcast (ToElementsOp toElementsOp, SmallVectorImpl< OpFoldResult > &results) |
| Folds vector.to_elements(vector.broadcast(x)) for the scalar case only. | |
| static OpFoldResult | foldFromElementsToElements (FromElementsOp fromElementsOp) |
| Folds vector.from_elements(vector.to_elements(vector)) into vector. | |
| static OpFoldResult | foldFromElementsToConstant (FromElementsOp fromElementsOp, ArrayRef< Attribute > elements) |
| Fold vector.from_elements to a constant when all operands are constants. | |
| static LogicalResult | rewriteFromElementsAsBroadcast (FromElementsOp fromElementsOp, PatternRewriter &rewriter) |
| Rewrite vector.from_elements as vector.broadcast if the elements are the same. | |
| static llvm::SetVector< int64_t > | computeBroadcastedUnitDims (ArrayRef< int64_t > srcShape, ArrayRef< int64_t > dstShape) |
| Return the dimensions of the result vector that were formerly ones in the source tensor and thus correspond to "dim-1" broadcasting. | |
| static LogicalResult | foldBroadcastOfShapeCast (BroadcastOp broadcastOp) |
| template<typename T> | |
| static bool | isStepIndexArray (ArrayRef< T > idxArr, uint64_t begin, size_t width) |
| static OpFoldResult | foldShuffleIdentityMask (ShuffleOp op) |
| Fold shuffle V1, V2, [0, 1, 2, 3] : <4xi32>, <2xi32> -> V1. | |
| static OpFoldResult | foldShufflePoisonOperandToMask (ShuffleOp op) |
| If a shuffle operand is poison, replace all mask indices that reference it with kPoisonIndex. | |
| static OpFoldResult | foldShufflePoisonInputs (MLIRContext *context, Attribute v1Attr, Attribute v2Attr) |
| Fold shuffle poison, poison -> poison. | |
| static OpFoldResult | foldShuffleConstantInputs (ShuffleOp op, Attribute v1Attr, Attribute v2Attr) |
| Fold a shuffle of constant 1-D inputs by evaluating the mask. | |
| static int64_t | calculateInsertPosition (VectorType destTy, ArrayRef< int64_t > positions) |
| static Attribute | foldDenseElementsAttrDestInsertOp (InsertOp insertOp, Attribute srcAttr, Attribute dstAttr, int64_t maxVectorSizeFoldThreshold) |
| static Value | foldInsertUseChain (InsertOp insertOp) |
| Folder to replace the dest operand of the insert op with the root dest of the insert op use chain. | |
| template<typename OpType> | |
| static LogicalResult | isIntegerArrayAttrSmallerThanShape (OpType op, ArrayAttr arrayAttr, ArrayRef< int64_t > shape, StringRef attrName) |
| template<typename OpType> | |
| static LogicalResult | isIntegerArrayAttrConfinedToRange (OpType op, ArrayAttr arrayAttr, int64_t min, int64_t max, StringRef attrName, bool halfOpen=true) |
| template<typename OpType> | |
| static LogicalResult | isIntegerArrayAttrConfinedToShape (OpType op, ArrayAttr arrayAttr, ArrayRef< int64_t > shape, StringRef attrName, bool halfOpen=true, int64_t min=0) |
| template<typename OpType> | |
| static LogicalResult | isSumOfIntegerArrayAttrConfinedToShape (OpType op, ArrayAttr arrayAttr1, ArrayAttr arrayAttr2, ArrayRef< int64_t > shape, StringRef attrName1, StringRef attrName2, bool halfOpen=true, int64_t min=1) |
| static ArrayAttr | makeI64ArrayAttr (ArrayRef< int64_t > values, MLIRContext *context) |
| static Type | inferStridedSliceOpResultType (VectorType vectorType, ArrayAttr offsets, ArrayAttr sizes, ArrayAttr strides) |
| static LogicalResult | foldExtractStridedOpFromInsertChain (ExtractStridedSliceOp op) |
| static OpFoldResult | foldExtractStridedSliceNonSplatConstant (ExtractStridedSliceOp op, Attribute foldInput) |
| template<typename EmitFun> | |
| static LogicalResult | verifyPermutationMap (AffineMap permutationMap, EmitFun emitOpError) |
| static LogicalResult | verifyTransferOp (VectorTransferOpInterface op, ShapedType shapedType, VectorType vectorType, VectorType maskType, VectorType inferredMaskType, AffineMap permutationMap, ArrayAttr inBounds) |
| static void | printTransferAttrs (OpAsmPrinter &p, VectorTransferOpInterface op) |
| template<typename TransferOp> | |
| static bool | isInBounds (TransferOp op, int64_t resultIdx, int64_t indicesIdx) |
| template<typename TransferOp> | |
| static LogicalResult | foldTransferInBoundsAttribute (TransferOp op) |
| template<typename TransferOp> | |
| static LogicalResult | foldTransferFullMask (TransferOp op) |
| template<typename TransferOp> | |
| static LogicalResult | foldSize1TransferPermutationMap (TransferOp op) |
| When the vector type is vector<1xT>, the permutation map is irrelevant: the single vector lane always has iteration offset 0, so the element is at indices regardless of which source dimension the map points at. | |
| #define GET_ATTRDEF_CLASSES |
| #define GET_ATTRDEF_LIST |
| #define GET_OP_CLASSES |
| #define GET_OP_LIST |
|
strong |
Helper enum to classify mask value.
| Enumerator | |
|---|---|
| AllTrue | |
| AllFalse | |
| Unknown | |
Definition at line 64 of file VectorOps.cpp.
Definition at line 3829 of file VectorOps.cpp.
References mlir::computeStrides(), copy(), and mlir::linearize().
Referenced by foldDenseElementsAttrDestInsertOp().
|
static |
Return the dimensions of the result vector that were formerly ones in the source tensor and thus correspond to "dim-1" broadcasting.
Definition at line 3101 of file VectorOps.cpp.
Converts numeric attributes to the expected type.
Supports integer-to-integer and float-to-integer conversions. Returns the original attribute if no conversion is needed or supported.
Definition at line 426 of file VectorOps.cpp.
Referenced by foldDenseElementsAttrDestInsertOp(), and foldFromElementsToConstant().
|
static |
If the dynamic indices of extractOp or insertOp are in fact constants, then fold it.
Definition at line 2188 of file VectorOps.cpp.
References vectorShape().
|
static |
Definition at line 1531 of file VectorOps.cpp.
References ArrayAttr().
Referenced by foldExtractFromExtractStrided(), and foldExtractStridedOpFromInsertChain().
|
static |
Definition at line 3258 of file VectorOps.cpp.
References mlir::vector::isBroadcastableTo(), mlir::vector::Success, and success().
|
static |
Converts attribute to the expected type if there's a mismatch.
Definition at line 4004 of file VectorOps.cpp.
References calculateInsertPosition(), convertNumericAttr(), copy(), and mlir::DenseElementsAttr::get().
Fold a vector extract extracting from a DenseElementsAttr.
Definition at line 2255 of file VectorOps.cpp.
References mlir::computeStrides(), copy(), mlir::DenseElementsAttr::get(), and mlir::linearize().
|
static |
Fold extract(broadcast(X)) to either extract(X) or just X.
Example:
broadcast extract [1][2]
(3, 4) --------> (2, 3, 4) ----------------> (4)
becomes extract [1] (3,4) -------------------------------------> (4)
The variable names used in this implementation correspond to the above shapes as,
This folding is possible when the suffix of input shape is the same as extract shape.
Definition at line 1858 of file VectorOps.cpp.
References mlir::decomposeMixedValues(), mlir::Builder::getIndexAttr(), mlir::Operation::getOperand(), mlir::Value::getType(), isBroadcastLike(), and ValueRange.
|
static |
Fold an ExtractOp from ExtractStridedSliceOp.
Definition at line 2020 of file VectorOps.cpp.
References b, extractVector(), and hasZeroDimVectors().
|
static |
Definition at line 1955 of file VectorOps.cpp.
References b, mlir::delinearize(), and mlir::linearize().
|
static |
Fold extractOp coming from ShuffleOp.
Example:
shuffle = vector.shuffle a, b [0, 8, 7, 15] : vector<8xf32>, vector<8xf32> extract = vector.extract shuffle[3] : f32 from vector<4xf32> -> extract = vector.extract b[7] : f32 from vector<8xf32>
Definition at line 1923 of file VectorOps.cpp.
|
static |
Fold the result of chains of ExtractOp in place by simply concatenating the positions.
Both static and dynamic positions are supported.
BEFORE:
AFTER:
Definition at line 1550 of file VectorOps.cpp.
References mlir::decomposeMixedValues(), success(), and ValueRange.
|
static |
Fold extract_op fed from a chain of insertStridedSlice ops.
Definition at line 2072 of file VectorOps.cpp.
References b, extractVector(), and hasZeroDimVectors().
|
static |
Definition at line 4646 of file VectorOps.cpp.
References ArrayAttr(), b, extractStrides(), and success().
|
static |
Definition at line 4710 of file VectorOps.cpp.
References mlir::computeStrides(), copy(), mlir::DenseElementsAttr::get(), mlir::getI64SubArray(), incSlicePosition(), and mlir::linearize().
|
static |
Fold vector.from_elements to a constant when all operands are constants.
Example: c1 = arith.constant 1 : i32 c2 = arith.constant 2 : i32 v = vector.from_elements c1, c2 : vector<2xi32> => v = arith.constant dense<[1, 2]> : vector<2xi32>
Definition at line 2912 of file VectorOps.cpp.
References convertNumericAttr(), mlir::DenseElementsAttr::get(), mlir::ub::m_Poison(), and mlir::matchPattern().
|
static |
Folds vector.from_elements(vector.to_elements(vector)) into vector.
Case #1: Input and output vectors are the same.
%0:3 = vector.to_elements a : vector<3xf32> %1 = vector.from_elements %0#0, %0#1, %0#2 : vector<3xf32> user_op %1
becomes:
user_op a
Definition at line 2879 of file VectorOps.cpp.
References mlir::Value::getType(), and haveSameDefiningOp().
|
static |
Folder to replace the dest operand of the insert op with the root dest of the insert op use chain.
Definition at line 4056 of file VectorOps.cpp.
References mlir::Value::getDefiningOp(), and mlir::Operation::setOperand().
|
static |
Fold an insert or extract operation into an poison value when a poison index is found at any dimension of the static position.
Definition at line 2237 of file VectorOps.cpp.
Fold a vector extract from is a poison source.
Definition at line 2247 of file VectorOps.cpp.
References mlir::ub::m_Poison(), and mlir::matchPattern().
|
static |
Try to fold the extraction of a scalar from a vector defined by vector.from_elements.
E.g.:
%0 = vector.from_elements a, b : vector<2xf32> %1 = vector.extract %0[0] : f32 from vector<2xf32> ==> fold to a
Definition at line 2152 of file VectorOps.cpp.
References mlir::Value::getDefiningOp(), and indices.
|
static |
Fold a shuffle of constant 1-D inputs by evaluating the mask.
Definition at line 3495 of file VectorOps.cpp.
References mlir::DenseElementsAttr::get(), mlir::ub::m_Poison(), and mlir::matchPattern().
|
static |
Fold shuffle V1, V2, [0, 1, 2, 3] : <4xi32>, <2xi32> -> V1.
Fold shuffle V1, V2, [4, 5] : <4xi32>, <2xi32> -> V2.
Definition at line 3446 of file VectorOps.cpp.
References isStepIndexArray().
|
static |
Fold shuffle poison, poison -> poison.
Definition at line 3485 of file VectorOps.cpp.
References mlir::ub::m_Poison(), and mlir::matchPattern().
|
static |
If a shuffle operand is poison, replace all mask indices that reference it with kPoisonIndex.
This is an in-place fold.
Definition at line 3459 of file VectorOps.cpp.
References mlir::ub::m_Poison(), and mlir::matchPattern().
|
static |
When the vector type is vector<1xT>, the permutation map is irrelevant: the single vector lane always has iteration offset 0, so the element is at indices regardless of which source dimension the map points at.
Replace with the minor identity to unblock lowering to vector.load / vector.store.
Definition at line 5564 of file VectorOps.cpp.
References mlir::AffineMap::getMinorIdentityMap(), mlir::AffineMap::getPermutationMap(), mlir::AffineMap::isMinorIdentity(), and success().
|
static |
Folds vector.to_elements(vector.from_elements(e0, e1, ...)) into (e0, e1, ...).
For example:
%0 = vector.from_elements a, b, c : vector<3xf32> %1:3 = vector.to_elements %0 : vector<3xf32> user_op %1#0, %1#1, %1#2
becomes:
user_op a, b, c
Definition at line 2714 of file VectorOps.cpp.
References success().
|
static |
Folds vector.to_elements(vector.broadcast(x)) for the scalar case only.
Example: b = vector.broadcast x : i32 to vector<3xf32> e:3 = vector.to_elements b : vector<3xf32> user_op e#0, e#1, e#2 becomes: user_op x, x, x
The vector source case is handled by a canonicalization pattern.
Definition at line 2736 of file VectorOps.cpp.
References success().
|
static |
Definition at line 5547 of file VectorOps.cpp.
References AllTrue, getMaskFormat(), and success().
|
static |
Definition at line 5492 of file VectorOps.cpp.
References b, mlir::AffineMap::getBroadcastDims(), mlir::AffineMap::getPermutationMap(), mlir::AffineMap::getResult(), isInBounds(), and success().
|
static |
Definition at line 1302 of file VectorOps.cpp.
References ArrayAttr(), contract(), mlir::getAffineDimExpr(), and getResultIndex().
|
static |
Returns the effective rank of the vector to read/write for Xfer Ops.
When the element type of the shaped type is a scalar, this will simply return the rank of the vector ( the result for xfer_read or the value to store for xfer_write).
When the element type of the base shaped type is a vector, returns the difference between the original vector type and the element type of the shaped type.
EXAMPLE 1 (element type is a scalar):
EXAMPLE 2 (element type is a vector):
This is used to determine the number of minor dimensions for identity maps in vector transfer Ops.
Definition at line 185 of file VectorOps.cpp.
Referenced by mlir::vector::getTransferMinorIdentityMap().
|
static |
Helper method to classify a mask value.
Currently, the method looks "under the hood" of a constant value with dense attributes and a constant mask operation (since the client may be called at various stages during progressive lowering).
Definition at line 74 of file VectorOps.cpp.
References AllFalse, AllTrue, b, and Unknown.
Referenced by foldTransferFullMask().
|
static |
Definition at line 1151 of file VectorOps.cpp.
References contract(), and mlir::AffineMap::isFunctionOfDim().
|
static |
Definition at line 1289 of file VectorOps.cpp.
References mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().
Referenced by getDimPairForIterTy().
Returns true if the operation has a 0-D vector type operand or result.
Definition at line 1806 of file VectorOps.cpp.
References mlir::Operation::getOperandTypes(), and mlir::Operation::getResultTypes().
Referenced by foldExtractFromExtractStrided(), and foldExtractStridedOpFromInsertChain().
|
static |
Returns true if all the operands are defined by defOp.
Otherwise, returns false.
Definition at line 2692 of file VectorOps.cpp.
References mlir::Value::getDefiningOp().
Referenced by foldFromElementsToElements().
|
static |
Definition at line 351 of file VectorOps.cpp.
References success().
Referenced by foldExtractStridedSliceNonSplatConstant().
|
static |
Definition at line 4554 of file VectorOps.cpp.
References ArrayAttr().
All BroadcastOps, as well as ShapeCastOps that only prepend 1s, are considered to be 'broadcastlike'.
Definition at line 1818 of file VectorOps.cpp.
Referenced by foldExtractFromBroadcast().
|
static |
Definition at line 5463 of file VectorOps.cpp.
References mlir::getConstantIntValue().
Referenced by foldTransferInBoundsAttribute().
|
static |
Definition at line 4138 of file VectorOps.cpp.
References ArrayAttr(), max(), min(), and success().
|
static |
Definition at line 4158 of file VectorOps.cpp.
References ArrayAttr(), max(), min(), and success().
|
static |
Definition at line 4123 of file VectorOps.cpp.
References ArrayAttr(), and success().
|
static |
Check if write is of a constant splat and the masked read is padded with the same splat value – meaning it could be the same value as the initial constant splat.
Definition at line 213 of file VectorOps.cpp.
References mlir::DenseElementsAttr::getSplatValue(), mlir::DenseElementsAttr::isSplat(), mlir::m_Constant(), and mlir::matchPattern().
|
static |
Definition at line 3437 of file VectorOps.cpp.
Referenced by foldShuffleIdentityMask().
|
static |
Definition at line 4181 of file VectorOps.cpp.
References ArrayAttr(), max(), min(), and success().
Definition at line 136 of file VectorOps.cpp.
References mlir::Type::isIntOrIndex(), and mlir::Type::isIntOrIndexOrFloat().
Definition at line 1434 of file VectorOps.cpp.
|
static |
Definition at line 4202 of file VectorOps.cpp.
References ArrayAttr().
|
static |
Definition at line 2672 of file VectorOps.cpp.
References ArrayAttr().
|
static |
Definition at line 5288 of file VectorOps.cpp.
References b, and mlir::OpAsmPrinter::printOptionalAttrDict().
|
static |
Rewrite vector.from_elements as vector.broadcast if the elements are the same.
Example: %0 = vector.from_elements a, a, a : vector<3xf32> => %0 = vector.broadcast a : f32 to vector<3xf32>
Definition at line 2950 of file VectorOps.cpp.
References mlir::RewriterBase::replaceOpWithNewOp(), and success().
|
static |
Definition at line 1042 of file VectorOps.cpp.
|
static |
Definition at line 1053 of file VectorOps.cpp.
References mlir::AffineMap::compose(), mlir::AffineMap::get(), mlir::getAffineConstantExpr(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getResults(), mlir::getUnusedDimsBitVector(), mlir::simplifyAffineMap(), and success().
|
static |
Definition at line 5180 of file VectorOps.cpp.
References mlir::AffineMap::getNumInputs(), mlir::AffineMap::getResults(), and success().
|
static |
Definition at line 5209 of file VectorOps.cpp.
References ArrayAttr(), mlir::DataLayout::closest(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), mlir::DataLayout::getTypeSizeInBits(), and success().