[Mlir-commits] [mlir] [MLIR][TOSA] Add --tosa-remove-redundant-transposes pass (PR #108260)

Jacques Pienaar llvmlistbot at llvm.org
Fri Sep 13 11:08:04 PDT 2024


================
@@ -126,4 +126,18 @@ def TosaValidation : Pass<"tosa-validate", "mlir::ModuleOp"> {
    ];
 }
 
+def TosaRemoveRedundantTransposes : Pass<"tosa-remove-redundant-transposes", "func::FuncOp"> {
+  let summary = "Remove redundant transposes";
+  let description = [{
+    Pass that identifies and removes redundant tosa.TRANSPOSE operations.
+    It does so by traversing dependencies of tosa.TRANSPOSE operations until they terminate in either
+    tosa.RESHAPE, a nullifying tosa.TRANSPOSE, or a tosa.CONST. It then propagates the downstream
+    transform upward through the intervening operators if it is able and replaces the downstream tosa.TRANSPOSE.
+    Results generally better when run after canonicalization and resolution of dynamic shapes.
----------------
jpienaar wrote:

I'd make this 3 paragraphs. 1 explaining what it does, one this sentence (although doesn't seem like its specific to this pass: post those two passes the IR is simplified, so many others could say same), and then a final one for framework side.

https://github.com/llvm/llvm-project/pull/108260


More information about the Mlir-commits mailing list