13 #ifndef MLIR_DIALECT_VECTOR_IR_VECTOROPS_H
14 #define MLIR_DIALECT_VECTOR_IR_VECTOROPS_H
32 #include "llvm/ADT/StringExtras.h"
35 #include "mlir/Dialect/Vector/IR/VectorEnums.h.inc"
37 #define GET_ATTRDEF_CLASSES
38 #include "mlir/Dialect/Vector/IR/VectorAttributes.h.inc"
42 class RewritePatternSet;
45 enum class AtomicRMWKind : uint64_t;
51 class TransferWriteOp;
72 std::pair<int, int> *mismatchingDims =
nullptr);
98 VectorType vectorType);
114 VectorTransferOpInterface transferB,
115 bool testDynamicValueUsingBounds =
false);
123 VectorTransferOpInterface transferB,
124 bool testDynamicValueUsingBounds =
false);
133 return cast<IteratorTypeAttr>(attr).getValue() == IteratorType::parallel;
138 return cast<IteratorTypeAttr>(attr).getValue() == IteratorType::reduction;
197 #define GET_OP_CLASSES
198 #include "mlir/Dialect/Vector/IR/VectorDialect.h.inc"
199 #include "mlir/Dialect/Vector/IR/VectorOps.h.inc"
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued.
Attributes are known-constant values of operations.
This class is a general helper class for creating context-global objects like types,...
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
Operation is the basic unit of execution within MLIR.
This class represents the benefit of a pattern match in a unitless scheme that ranges from 0 (very li...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
ArrayAttr getVectorSubscriptAttr(Builder &b, ArrayRef< int64_t > values)
Returns an integer array attribute containing the given values using the integer type required for su...
bool isReductionIterator(Attribute attr)
Returns true if attr has "reduction" iterator type semantics.
void buildTerminatedBody(OpBuilder &builder, Location loc)
Default callback to build a region with a 'vector.yield' terminator with no arguments.
SmallVector< arith::ConstantIndexOp > getAsConstantIndexOps(ArrayRef< Value > values)
Returns the constant index ops in values.
AffineMap getTransferMinorIdentityMap(ShapedType shapedType, VectorType vectorType)
Build the default minor identity map suitable for a vector transfer.
bool checkSameValueRAW(TransferWriteOp defWrite, TransferReadOp read)
Return true if the transfer_write fully writes the data accessed by the transfer_read.
Operation * maskOperation(OpBuilder &builder, Operation *maskableOp, Value mask, Value passthru=Value())
Creates a vector.mask operation around a maskable operation.
VectorType inferTransferOpMaskType(VectorType vecType, AffineMap permMap)
Infers the mask type for a transfer op given its vector type and permutation map.
Value selectPassthru(OpBuilder &builder, Value mask, Value newValue, Value passthru)
Creates a vector select operation that picks values from newValue or passthru for each result vector ...
bool isDisjointTransferIndices(VectorTransferOpInterface transferA, VectorTransferOpInterface transferB, bool testDynamicValueUsingBounds=false)
Return true if we can prove that the transfer operations access disjoint memory, without requring the...
bool isDisjointTransferSet(VectorTransferOpInterface transferA, VectorTransferOpInterface transferB, bool testDynamicValueUsingBounds=false)
Return true if we can prove that the transfer operations access disjoint memory, requiring the operat...
BroadcastableToResult isBroadcastableTo(Type srcType, VectorType dstVectorType, std::pair< int, int > *mismatchingDims=nullptr)
bool checkSameValueWAW(TransferWriteOp write, TransferWriteOp priorWrite)
Return true if the write op fully over-write the priorWrite transfer_write op.
bool isParallelIterator(Attribute attr)
Returns true if attr has "parallel" iterator type semantics.
void populateFoldArithExtensionPatterns(RewritePatternSet &patterns)
Collect a set of patterns that fold arithmetic extension on floating point into vector contract for t...
void populateVectorToVectorCanonicalizationPatterns(RewritePatternSet &patterns, PatternBenefit benefit=1)
Collect a set of vector-to-vector canonicalization patterns.
void createMaskOpRegion(OpBuilder &builder, Operation *maskableOp)
Create the vector.yield-ended region of a vector.mask op with maskableOp as masked operation.
SmallVector< Value > getAsValues(OpBuilder &builder, Location loc, ArrayRef< OpFoldResult > foldResults)
Convert foldResults into Values.
Value makeArithReduction(OpBuilder &b, Location loc, CombiningKind kind, Value v1, Value acc, Value mask=Value())
Return the result value of reducing two scalar/vector values with the corresponding arith operation.
Value getVectorReductionOp(arith::AtomicRMWKind op, OpBuilder &builder, Location loc, Value vector)
Returns the value obtained by reducing the vector into a scalar using the operation kind associated w...
BroadcastableToResult
Return whether srcType can be broadcast to dstVectorType under the semantics of the vector....
IntegerType getVectorSubscriptType(Builder &builder)
Returns the integer type required for subscripts in the vector dialect.
SmallVector< int64_t > getAsIntegers(ArrayRef< OpFoldResult > foldResults)
Returns the integer numbers in foldResults.
Include the generated interface declarations.