diff --git a/compiler/src/iree/compiler/Codegen/Common/GenericVectorization.cpp b/compiler/src/iree/compiler/Codegen/Common/GenericVectorization.cpp index 16a04bb308a27..207aacec1b1a5 100644 --- a/compiler/src/iree/compiler/Codegen/Common/GenericVectorization.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/GenericVectorization.cpp @@ -364,6 +364,16 @@ void GenericVectorizationPass::runOnOperation() { vectorizeGatherAccesses); }; + { + RewritePatternSet transferSliceFoldingPatterns(funcOp.getContext()); + tensor::populateFoldTensorSubsetIntoVectorTransferPatterns( + transferSliceFoldingPatterns); + if (failed(applyPatternsAndFoldGreedily(funcOp, + std::move(transferSliceFoldingPatterns)))) { + return signalPassFailure(); + } + } + { // Canonicalize mask related ops before we lower them. RewritePatternSet maskCanonPatterns(funcOp.getContext());