Skip to content

Commit

Permalink
Move cse & canon passes and delete extra preprocessing
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
  • Loading branch information
IanWood1 committed Oct 28, 2024
1 parent e6df5a2 commit 3260dff
Showing 1 changed file with 4 additions and 8 deletions.
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

0 comments on commit 3260dff

Please sign in to comment.