Skip to content

Commit

Permalink
[LLVMCPU] Simplify vector lowering for Mmt4dTilingExpert. (iree-org#1…
Browse files Browse the repository at this point in the history
…3769)

It removes OptimizeVectorTransferPass from the pipeline, and adds the flatten patterns to Mmt4dTilingExpert. This removes unneeded patterns from the pipeline.

Fixes iree-org#13753
  • Loading branch information
hanhanW authored and NatashaKnk committed Jul 6, 2023
1 parent ef96e0e commit d432ed8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ void LLVMCPUMmt4dVectorLoweringPass::runOnOperation() {
llvm::dbgs() << "\n\n";
});
}

// Flatten transfer ops.
{
RewritePatternSet patterns(&getContext());
mlir::vector::populateVectorTransferDropUnitDimsPatterns(patterns);
mlir::vector::populateFlattenVectorTransferPatterns(patterns);
if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(patterns)))) {
return signalPassFailure();
}
}
}

std::unique_ptr<OperationPass<func::FuncOp>>
Expand Down
2 changes: 0 additions & 2 deletions compiler/src/iree/compiler/Codegen/LLVMCPU/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,6 @@ void addMmt4dTilingExpertPassPipeline(OpPassManager &passManager,
if (!enableMicrokernels) {
nestedModulePM.addNestedPass<func::FuncOp>(
createLLVMCPUMmt4dVectorLoweringPass());
nestedModulePM.addNestedPass<func::FuncOp>(
createOptimizeVectorTransferPass(/*flatten=*/true));
}
}

Expand Down

0 comments on commit d432ed8

Please sign in to comment.