MLIR 24.0.0git
mlir::vector::UnrollVectorOptions Struct Reference

Options that control the vector unrolling. More...

#include "mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h"

Public Types

using FilterConstraintFnType = std::function<LogicalResult(Operation *op)>
using NativeShapeFnType
using UnrollTraversalOrderFnType
 Function that returns the traversal order (in terms of "for loop order", i.e.

Public Member Functions

UnrollVectorOptions & setFilterConstraint (FilterConstraintFnType constraint)
UnrollVectorOptions & setNativeShapeFn (NativeShapeFnType fn)
UnrollVectorOptions & setNativeShape (ArrayRef< int64_t > shape)
 Set the native shape to use for unrolling.
UnrollVectorOptions & setUnrollTraversalOrderFn (UnrollTraversalOrderFnType traversalOrderFn)

Public Attributes

FilterConstraintFnType filterConstraint = nullptr
 Callback function that indicates whether vector unrolling should be attempted on the operation.
NativeShapeFnType nativeShape = nullptr
 Function that returns the shape of the vector to unroll to for a given operation.
UnrollTraversalOrderFnType traversalOrderCallback = nullptr
SmallVector< int64_t > unrollOrderForContractOp = {}
 Unrolling order for ContractionOp.
bool reverseDefaultTraversalOrder = false
 Controls whether to reverse the unrolling order.

Detailed Description

Options that control the vector unrolling.

Definition at line 36 of file VectorRewritePatterns.h.

Member Typedef Documentation

◆ FilterConstraintFnType

using mlir::vector::UnrollVectorOptions::FilterConstraintFnType = std::function<LogicalResult(Operation *op)>

Definition at line 37 of file VectorRewritePatterns.h.

◆ NativeShapeFnType

Initial value:
std::function<std::optional<SmallVector<int64_t>>(Operation *op)>
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87

Definition at line 46 of file VectorRewritePatterns.h.

◆ UnrollTraversalOrderFnType

Initial value:
std::function<std::optional<SmallVector<int64_t>>(Operation *op)>

Function that returns the traversal order (in terms of "for loop order", i.e.

slowest varying dimension to fastest varying dimension) that should be used when unrolling the given operation into units of the native vector size.

Definition at line 70 of file VectorRewritePatterns.h.

Member Function Documentation

◆ setFilterConstraint()

UnrollVectorOptions & mlir::vector::UnrollVectorOptions::setFilterConstraint ( FilterConstraintFnType constraint)
inline

Definition at line 41 of file VectorRewritePatterns.h.

References filterConstraint.

◆ setNativeShape()

UnrollVectorOptions & mlir::vector::UnrollVectorOptions::setNativeShape ( ArrayRef< int64_t > shape)
inline

Set the native shape to use for unrolling.

Definition at line 58 of file VectorRewritePatterns.h.

References nativeShape.

◆ setNativeShapeFn()

UnrollVectorOptions & mlir::vector::UnrollVectorOptions::setNativeShapeFn ( NativeShapeFnType fn)
inline

◆ setUnrollTraversalOrderFn()

UnrollVectorOptions & mlir::vector::UnrollVectorOptions::setUnrollTraversalOrderFn ( UnrollTraversalOrderFnType traversalOrderFn)
inline

Definition at line 74 of file VectorRewritePatterns.h.

References traversalOrderCallback.

Member Data Documentation

◆ filterConstraint

FilterConstraintFnType mlir::vector::UnrollVectorOptions::filterConstraint = nullptr

Callback function that indicates whether vector unrolling should be attempted on the operation.

Definition at line 40 of file VectorRewritePatterns.h.

Referenced by setFilterConstraint().

◆ nativeShape

NativeShapeFnType mlir::vector::UnrollVectorOptions::nativeShape = nullptr

Function that returns the shape of the vector to unroll to for a given operation.

The unrolling is aborted if the function returns std::nullopt.

Definition at line 51 of file VectorRewritePatterns.h.

Referenced by setNativeShape(), and setNativeShapeFn().

◆ reverseDefaultTraversalOrder

bool mlir::vector::UnrollVectorOptions::reverseDefaultTraversalOrder = false

Controls whether to reverse the unrolling order.

Definition at line 85 of file VectorRewritePatterns.h.

◆ traversalOrderCallback

UnrollTraversalOrderFnType mlir::vector::UnrollVectorOptions::traversalOrderCallback = nullptr

Definition at line 72 of file VectorRewritePatterns.h.

Referenced by setUnrollTraversalOrderFn().

◆ unrollOrderForContractOp

SmallVector<int64_t> mlir::vector::UnrollVectorOptions::unrollOrderForContractOp = {}

Unrolling order for ContractionOp.

In general, this could be used by any other Op, but in practice it isn't and the name reflects that. The user is responsible for making sure that the number of indices matches the number of loops to be unrolled.

Definition at line 83 of file VectorRewritePatterns.h.


The documentation for this struct was generated from the following file: