MLIR  17.0.0git
Public Member Functions | List of all members
VectorizationState Struct Reference

Contains the vectorization state and related methods used across the vectorization process of a given operation. More...

Public Member Functions

 VectorizationState (RewriterBase &rewriter)
 
LogicalResult initState (RewriterBase &rewriter, LinalgOp linalgOp, ArrayRef< int64_t > inputVectorSizes)
 Initializes the vectorization state, including the computation of the canonical vector shape for vectorization. More...
 
ArrayRef< int64_t > getCanonicalVecShape () const
 Returns the canonical vector shape used to vectorize the iteration space. More...
 
OperationmaskOperation (RewriterBase &rewriter, Operation *opToMask, LinalgOp linalgOp, std::optional< AffineMap > maybeMaskingMap=std::nullopt)
 Masks an operation with the canonical vector mask if the operation needs masking. More...
 

Detailed Description

Contains the vectorization state and related methods used across the vectorization process of a given operation.

Definition at line 174 of file Vectorization.cpp.

Constructor & Destructor Documentation

◆ VectorizationState()

VectorizationState::VectorizationState ( RewriterBase rewriter)
inline

Definition at line 175 of file Vectorization.cpp.

Member Function Documentation

◆ getCanonicalVecShape()

ArrayRef<int64_t> VectorizationState::getCanonicalVecShape ( ) const
inline

Returns the canonical vector shape used to vectorize the iteration space.

Definition at line 183 of file Vectorization.cpp.

Referenced by buildVectorWrite(), and vectorizeAsLinalgGeneric().

◆ initState()

LogicalResult VectorizationState::initState ( RewriterBase rewriter,
LinalgOp  linalgOp,
ArrayRef< int64_t >  inputVectorSizes 
)

Initializes the vectorization state, including the computation of the canonical vector shape for vectorization.

Definition at line 270 of file Vectorization.cpp.

References mlir::failed(), mlir::failure(), initState(), LDBG, mlir::OpBuilder::setInsertionPoint(), and mlir::success().

Referenced by initState().

◆ maskOperation()

Operation * VectorizationState::maskOperation ( RewriterBase rewriter,
Operation opToMask,
LinalgOp  linalgOp,
std::optional< AffineMap maybeMaskingMap = std::nullopt 
)

Masks an operation with the canonical vector mask if the operation needs masking.

Returns the masked operation or the original operation if masking is not needed. If provided, the canonical mask for this operation is permuted using maybeMaskingMap.

Definition at line 379 of file Vectorization.cpp.

References mlir::detail::enumerate(), mlir::Operation::getResults(), LDBG, mlir::vector::maskOperation(), and mlir::RewriterBase::replaceAllUsesExcept().

Referenced by buildVectorWrite(), and vectorizeAsLinalgGeneric().


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