9#ifndef MLIR_DIALECT_VECTOR_TRANSFORMS_VECTORREWRITEPATTERNS_H
10#define MLIR_DIALECT_VECTOR_TRANSFORMS_VECTORREWRITEPATTERNS_H
19#include "mlir/Dialect/Vector/Transforms/VectorTransformsEnums.h.inc"
22class ConversionTarget;
47 std::function<std::optional<SmallVector<int64_t>>(
Operation *op)>;
71 std::function<std::optional<SmallVector<int64_t>>(
Operation *op)>;
105 std::function<LogicalResult(vector::ContractionOp)> constraint =
106 [](vector::ContractionOp) {
return success(); },
117 bool allowFastMathFlagLoss =
true);
227void populateBreakDownVectorReductionPatterns(
253void populateVectorInsertExtractStridedSliceDecompositionPatterns(
262void populateVectorExtractStridedSliceToExtractInsertChainPatterns(
264 std::function<
bool(ExtractStridedSliceOp)> controlFn =
nullptr,
278void populateBreakDownVectorBitCastOpPatterns(
280 std::function<
bool(BitCastOp)> controlFn =
nullptr,
301void populateVectorInsertExtractStridedSliceTransforms(
335 const UnrollVectorOptions &
options,
347 const UnrollVectorOptions &
options,
395void populateFlattenVectorTransferPatterns(
397 unsigned targetVectorBitwidth = std::numeric_limits<unsigned>::max(),
410 bool force32BitVectorIndices,
421void populateVectorNarrowTypeEmulationPatterns(
424 bool assumeAligned =
false);
432void populateMemRefFlattenAndVectorNarrowTypeEmulationPatterns(
443void populateVectorTransposeNarrowTypeRewritePatterns(
469void populateVectorLinearizeBitWidthTargetRules(
475void populateVectorLinearizeBasePatterns(
const TypeConverter &,
481void populateVectorLinearizeShuffleLikeOpsPatterns(
const TypeConverter &,
static llvm::ManagedStatic< PassManagerOptions > options
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued.
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...
Converts narrow integer or float types that are not supported by the target hardware to wider types.
void populateVectorReductionToContractPatterns(RewritePatternSet &patterns, PatternBenefit benefit=1, bool allowFastMathFlagLoss=true)
Collect patterns to convert reduction op to vector.contract and fold transpose/broadcast ops into the...
void populateDropInnerMostUnitDimsXferOpPatterns(RewritePatternSet &patterns, PatternBenefit benefit=1)
Collect a set of patterns to collapse the most inner unit dims in xfer Ops.
void populateVectorContractCanonicalizeMatmulToMMT(RewritePatternSet &patterns, std::function< LogicalResult(vector::ContractionOp)> constraint=[](vector::ContractionOp) { return success();}, PatternBenefit=1)
Canonicalization of a vector.contract a, b, c with row-major matmul semantics to a contraction with M...
void populateSinkVectorOpsPatterns(RewritePatternSet &patterns, PatternBenefit benefit=1)
Patterns that remove redundant Vector Ops by re-ordering them with e.g.
void populateVectorTransferFullPartialPatterns(RewritePatternSet &patterns, const VectorTransformsOptions &options)
Populate patterns with the following patterns.
Include the generated interface declarations.
Options that control the vector unrolling.
std::function< std::optional< SmallVector< int64_t > >(Operation *op)> UnrollTraversalOrderFnType
Function that returns the traversal order (in terms of "for loop order", i.e.
FilterConstraintFnType filterConstraint
Callback function that indicates whether vector unrolling should be attempted on the operation.
bool reverseDefaultTraversalOrder
Controls whether to reverse the unrolling order.
std::function< LogicalResult(Operation *op)> FilterConstraintFnType
NativeShapeFnType nativeShape
Function that returns the shape of the vector to unroll to for a given operation.
UnrollVectorOptions & setFilterConstraint(FilterConstraintFnType constraint)
UnrollVectorOptions & setNativeShape(ArrayRef< int64_t > shape)
Set the native shape to use for unrolling.
UnrollTraversalOrderFnType traversalOrderCallback
SmallVector< int64_t > unrollOrderForContractOp
Unrolling order for ContractionOp.
UnrollVectorOptions & setNativeShapeFn(NativeShapeFnType fn)
UnrollVectorOptions & setUnrollTraversalOrderFn(UnrollTraversalOrderFnType traversalOrderFn)
std::function< std::optional< SmallVector< int64_t > >(Operation *op)> NativeShapeFnType