Skip to content

Commit

Permalink
Revert "Revert "[DispatchCreation] Run preprocessing before..." (#18934
Browse files Browse the repository at this point in the history
…)"

This reverts commit b31b033.
  • Loading branch information
IanWood1 authored Oct 29, 2024
1 parent a321be2 commit 4d9ca84
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions compiler/src/iree/compiler/DispatchCreation/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +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 All @@ -148,6 +151,7 @@ void addDispatchRegionCreationPreprocessingPasses(OpPassManager &passManager) {

// 3. Perform elementwise operation fusion again (now with higher
// dimensionality).
.addPass(DispatchCreation::createFusionPreprocessingPass)
.addPass([]() {
return DispatchCreation::createElementwiseOpFusionPass(
ElementwiseOpFusionPassOptions{
Expand Down Expand Up @@ -294,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 4d9ca84

Please sign in to comment.