Skip to content

Commit c891a27

Browse files
committed
populate patterns inside populateVectorUnrollPatterns
1 parent 08655a9 commit c891a27

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,8 +1495,6 @@ LogicalResult mlir::spirv::unrollVectorsInFuncBodies(Operation *op) {
14951495
RewritePatternSet patterns(context);
14961496
auto options = vector::UnrollVectorOptions().setNativeShapeFn(
14971497
[](auto op) { return mlir::spirv::getNativeVectorShape(op); });
1498-
vector::populateVectorFromElementsLoweringPatterns(patterns);
1499-
vector::populateVectorToElementsLoweringPatterns(patterns);
15001498
populateVectorUnrollPatterns(patterns, options);
15011499
if (failed(applyPatternsGreedily(op, std::move(patterns))))
15021500
return failure();

mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "mlir/Dialect/Affine/IR/AffineOps.h"
1414
#include "mlir/Dialect/Utils/IndexingUtils.h"
15+
#include "mlir/Dialect/Vector/Transforms/LoweringPatterns.h"
1516
#include "mlir/Dialect/Vector/Transforms/VectorTransforms.h"
1617
#include "mlir/Interfaces/VectorInterfaces.h"
1718
#include "llvm/ADT/MapVector.h"
@@ -814,6 +815,8 @@ struct UnrollBroadcastPattern : public OpRewritePattern<vector::BroadcastOp> {
814815
void mlir::vector::populateVectorUnrollPatterns(
815816
RewritePatternSet &patterns, const UnrollVectorOptions &options,
816817
PatternBenefit benefit) {
818+
populateVectorToElementsLoweringPatterns(patterns);
819+
populateVectorFromElementsLoweringPatterns(patterns);
817820
patterns.add<UnrollTransferReadPattern, UnrollTransferWritePattern,
818821
UnrollContractionPattern, UnrollElementwisePattern,
819822
UnrollReductionPattern, UnrollMultiReductionPattern,

0 commit comments

Comments
 (0)