[Mlir-commits] [mlir] [MLIR][Transform] Make TransformState constructor public (PR #101186)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Aug 21 09:32:39 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff ddb5480e6799d0de72c2cd34c1e7f9ffd154e660 a7f7b2459344edae711c11d8863abd236db8f356 --extensions h,cpp -- mlir/test/lib/Dialect/Transform/TestPassStateExtensionCommunication.cpp mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.cpp mlir/test/lib/Dialect/Transform/TestTransformStateExtension.h mlir/tools/mlir-opt/mlir-opt.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h b/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
index 0bb6037a77..43193e4cd4 100644
--- a/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
+++ b/mlir/include/mlir/Dialect/Transform/Interfaces/TransformInterfaces.h
@@ -131,13 +131,13 @@ private:
 /// will be executed following the internal logic of the operation. It must
 /// have the `PossibleTopLevelTransformOp` trait and not have any operands.
 /// This function internally keeps track of the transformation state.
-LogicalResult
-applyTransforms(Operation *payloadRoot, TransformOpInterface transform,
-                const RaggedArray<MappedValue> &extraMapping = {},
-                const TransformOptions &options = TransformOptions(),
-                bool enforceToplevelTransformOp = true,
-                function_ref<void (TransformState &)> stateInitializer = nullptr,
-                function_ref<LogicalResult (TransformState &)> stateExporter = nullptr);
+LogicalResult applyTransforms(
+    Operation *payloadRoot, TransformOpInterface transform,
+    const RaggedArray<MappedValue> &extraMapping = {},
+    const TransformOptions &options = TransformOptions(),
+    bool enforceToplevelTransformOp = true,
+    function_ref<void(TransformState &)> stateInitializer = nullptr,
+    function_ref<LogicalResult(TransformState &)> stateExporter = nullptr);
 
 /// The state maintained across applications of various ops implementing the
 /// TransformOpInterface. The operations implementing this interface and the
@@ -217,11 +217,11 @@ private:
 #endif // LLVM_ENABLE_ABI_BREAKING_CHECKS
   };
 
-  friend LogicalResult applyTransforms(Operation *, TransformOpInterface,
-                                       const RaggedArray<MappedValue> &,
-                                       const TransformOptions &, bool,
-                                       function_ref<void (TransformState &)>,
-                                       function_ref<LogicalResult (TransformState &)>);
+  friend LogicalResult
+  applyTransforms(Operation *, TransformOpInterface,
+                  const RaggedArray<MappedValue> &, const TransformOptions &,
+                  bool, function_ref<void(TransformState &)>,
+                  function_ref<LogicalResult(TransformState &)>);
 
   friend TransformState
   detail::makeTransformStateForTesting(Region *region, Operation *payloadRoot);
diff --git a/mlir/test/lib/Dialect/Transform/TestPassStateExtensionCommunication.cpp b/mlir/test/lib/Dialect/Transform/TestPassStateExtensionCommunication.cpp
index 4b5958af21..206bd192df 100644
--- a/mlir/test/lib/Dialect/Transform/TestPassStateExtensionCommunication.cpp
+++ b/mlir/test/lib/Dialect/Transform/TestPassStateExtensionCommunication.cpp
@@ -1,4 +1,5 @@
-//===- TestPassStateExtensionCommunication.cpp -----------------------------===//
+//===- TestPassStateExtensionCommunication.cpp
+//-----------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/mlir/test/lib/Dialect/Transform/TestTransformStateExtension.h b/mlir/test/lib/Dialect/Transform/TestTransformStateExtension.h
index bbcbabea01..54d00c70cf 100644
--- a/mlir/test/lib/Dialect/Transform/TestTransformStateExtension.h
+++ b/mlir/test/lib/Dialect/Transform/TestTransformStateExtension.h
@@ -39,16 +39,19 @@ class TransformStateInitializerExtension
     : public transform::TransformState::Extension {
 public:
   TransformStateInitializerExtension(transform::TransformState &state,
-                              int numOp, SmallVector<std::string>& registeredOps)
+                                     int numOp,
+                                     SmallVector<std::string> &registeredOps)
       : Extension(state), numOp(numOp), registeredOps(registeredOps) {}
 
   int getNumOp() { return numOp; }
   void setNumOp(int num) { numOp = num; }
   SmallVector<std::string> getRegisteredOps() { return registeredOps; }
-  void pushRegisteredOps(const std::string& newOp) { registeredOps.push_back(newOp); }
+  void pushRegisteredOps(const std::string &newOp) {
+    registeredOps.push_back(newOp);
+  }
   std::string printMessage() const {
     std::string message = "Registered transformOps are: ";
-    for (const auto& op : registeredOps) {
+    for (const auto &op : registeredOps) {
       message += op + " | ";
     }
     return message;

``````````

</details>


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


More information about the Mlir-commits mailing list