Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DispatchCreation] Run preprocessing before elementwise fusion #18920

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move cse & canon passes and delete extra preprocessing
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
  • Loading branch information
IanWood1 committed Oct 28, 2024
commit 3260dfffc5c80f0e7818ba7dbc237959f19d5fcd
12 changes: 4 additions & 8 deletions compiler/src/iree/compiler/DispatchCreation/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@ static void addCleanupPatterns(OpPassManager &passManager) {
//===----------------------------------------------------------------------===//

void addDispatchRegionCreationPreprocessingPasses(OpPassManager &passManager) {
// 1. Do some simple elementwise op fusion. This could be skipped,
// but could reduce the surface area of ops to handle later.
FunctionLikeNest(passManager)
.addPass(IREE::Flow::createCanonicalizerPass)
.addPass(mlir::createCSEPass)
.addPass(DispatchCreation::createFusionPreprocessingPass)
// 1. Do some simple elementwise op fusion. This could be skipped,
// but could reduce the surface area of ops to handle later.
.addPass([]() {
return DispatchCreation::createElementwiseOpFusionPass(
ElementwiseOpFusionPassOptions{
Expand Down Expand Up @@ -296,12 +298,6 @@ void buildDispatchCreationPassPipeline(
IREE::Util::createFixedPointIteratorPass(std::move(ipoPipeline)));
}

FunctionLikeNest(passManager)
// Preprocess the input to a form more amenable for fusion.
.addPass(DispatchCreation::createFusionPreprocessingPass)
.addPass(IREE::Flow::createCanonicalizerPass)
.addPass(mlir::createCSEPass);

addDispatchRegionCreationPreprocessingPasses(passManager);
addDispatchRegionCreationPasses(passManager);

Expand Down
Loading