From 3260dfffc5c80f0e7818ba7dbc237959f19d5fcd Mon Sep 17 00:00:00 2001 From: Ian Wood Date: Mon, 28 Oct 2024 19:42:20 +0000 Subject: [PATCH] Move cse & canon passes and delete extra preprocessing Signed-off-by: Ian Wood --- .../src/iree/compiler/DispatchCreation/Passes.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/compiler/src/iree/compiler/DispatchCreation/Passes.cpp b/compiler/src/iree/compiler/DispatchCreation/Passes.cpp index 9f3887e55f2a..9cf5732962fd 100644 --- a/compiler/src/iree/compiler/DispatchCreation/Passes.cpp +++ b/compiler/src/iree/compiler/DispatchCreation/Passes.cpp @@ -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{ @@ -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);