File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
iree/compiler/Dialect/Stream/Transforms Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -223,13 +223,15 @@ void buildStreamCmdPassPipeline(OpPassManager &passManager,
223
223
224
224
void buildStreamOptimizationPassPipeline (
225
225
OpPassManager &passManager, const TransformOptions &transformOptions) {
226
+ // Forming streams involves a fair amount of subgraph stitching, which can
227
+ // cause duplication. Run CSE to collapse.
228
+ addCleanupPatterns (passManager);
229
+
226
230
// ----------------------------------------------------------------------------
227
231
// Binding optimization
228
232
// ----------------------------------------------------------------------------
229
233
230
234
if (transformOptions.optimizeBindings ) {
231
- // Canonicalizer needs to run so that we have predictable inputs for fusion.
232
- passManager.addPass (mlir::createCanonicalizerPass ());
233
235
passManager.addPass (IREE::Stream::createFuseDispatchBindingsPass ());
234
236
235
237
// Folding operands requires that CSE folds the inputs that we check for.
@@ -284,8 +286,7 @@ void buildStreamTransformPassPipeline(
284
286
// Post-pipeline cleanup
285
287
// ----------------------------------------------------------------------------
286
288
287
- // Forming streams involves a fair amount of subgraph stitching, which can
288
- // cause duplication. Run CSE to collapse.
289
+ // Final cleanup after we optimize dispatches and fuse operands and bindings.
289
290
addCleanupPatterns (passManager);
290
291
291
292
// Symbol DCE any remaining variables/functions that are now no longer
You can’t perform that action at this time.
0 commit comments