[Mlir-commits] [mlir] 104a827 - Move LinalgDetensorize pass option from .cpp file to the .td declaration (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sat Jan 1 13:20:46 PST 2022


Author: Mehdi Amini
Date: 2022-01-01T21:19:31Z
New Revision: 104a827ea6de0cbe0f5faef4407552ede31d165c

URL: https://github.com/llvm/llvm-project/commit/104a827ea6de0cbe0f5faef4407552ede31d165c
DIFF: https://github.com/llvm/llvm-project/commit/104a827ea6de0cbe0f5faef4407552ede31d165c.diff

LOG: Move LinalgDetensorize pass option from .cpp file to the .td declaration (NFC)

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Linalg/Passes.td
    mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/Passes.td b/mlir/include/mlir/Dialect/Linalg/Passes.td
index 5bcc8cc6e33f1..893487df4a35a 100644
--- a/mlir/include/mlir/Dialect/Linalg/Passes.td
+++ b/mlir/include/mlir/Dialect/Linalg/Passes.td
@@ -237,6 +237,12 @@ def LinalgDetensorize : Pass<"linalg-detensorize", ""> {
     run on others. This is because it performs specific legalization of the
     blocks that make up the body, which it assumes has a FunctionLike trait.
   }];
+  let options = [
+    Option<"aggressiveMode", "aggressive-mode", "bool", /*default=*/"false",
+           "Detensorize all ops that qualify for detensoring along with branch"
+           " operands and basic-block arguments.">
+
+  ];
 }
 
 def LinalgStrategyTileAndFusePass

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
index 9be95a1815334..a20da7ffa2071 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
@@ -196,8 +196,6 @@ struct ExtractFromReshapeFromElements
 /// @see LinalgDetensorize in Linalg/Passes.td for more details.
 struct LinalgDetensorize : public LinalgDetensorizeBase<LinalgDetensorize> {
   LinalgDetensorize() = default;
-  LinalgDetensorize(const LinalgDetensorize &pass)
-      : LinalgDetensorizeBase<LinalgDetensorize>() {}
 
   class CostModel {
   public:
@@ -600,11 +598,6 @@ struct LinalgDetensorize : public LinalgDetensorizeBase<LinalgDetensorize> {
                                             std::move(canonPatterns))))
       signalPassFailure();
   }
-
-  Option<bool> aggressiveMode{
-      *this, "aggressive-mode",
-      llvm::cl::desc("Detensorize all ops that qualify for detensoring along "
-                     "with branch operands and basic-block arguments.")};
 };
 } // namespace
 


        


More information about the Mlir-commits mailing list