[Mlir-commits] [mlir] 173fce4 - [mlir][tosa] Update default tosa-to-linalg passes

Rob Suderman llvmlistbot at llvm.org
Thu Jan 13 10:19:43 PST 2022


Author: Rob Suderman
Date: 2022-01-13T10:17:44-08:00
New Revision: 173fce42052d8233ec0c83b87f2143d048f521ea

URL: https://github.com/llvm/llvm-project/commit/173fce42052d8233ec0c83b87f2143d048f521ea
DIFF: https://github.com/llvm/llvm-project/commit/173fce42052d8233ec0c83b87f2143d048f521ea.diff

LOG: [mlir][tosa] Update default tosa-to-linalg passes

Adding the optional decompositions have been verified to improve memory
usage on common models. Added the decomposition to the default tosa to linalg
passes.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D117175

Added: 
    

Modified: 
    mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
index e75e8d72bc2ea..cfc31ded98835 100644
--- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
+++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
@@ -68,10 +68,13 @@ std::unique_ptr<Pass> mlir::tosa::createTosaToLinalg() {
 }
 
 void mlir::tosa::addTosaToLinalgPasses(OpPassManager &pm) {
+  // Optional decompositions are designed to benefit linalg.
   pm.addNestedPass<FuncOp>(mlir::tosa::createTosaOptionalDecompositions());
-  pm.addNestedPass<FuncOp>(createTosaMakeBroadcastablePass());
-  pm.addNestedPass<FuncOp>(createTosaToLinalgNamed());
   pm.addNestedPass<FuncOp>(mlir::createCanonicalizerPass());
-  pm.addNestedPass<FuncOp>(createTosaMakeBroadcastablePass());
-  pm.addNestedPass<FuncOp>(createTosaToLinalg());
+
+  pm.addNestedPass<FuncOp>(tosa::createTosaMakeBroadcastablePass());
+  pm.addNestedPass<FuncOp>(tosa::createTosaToLinalgNamed());
+  pm.addNestedPass<FuncOp>(mlir::createCanonicalizerPass());
+  pm.addNestedPass<FuncOp>(tosa::createTosaMakeBroadcastablePass());
+  pm.addNestedPass<FuncOp>(tosa::createTosaToLinalg());
 }


        


More information about the Mlir-commits mailing list