[Mlir-commits] [mlir] [mlir] NamedAttribute utility generator (PR #75118)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Dec 14 12:21:12 PST 2023


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 c94f7804877ed39a67d58efa27ea190170d30bc3 a0c372862ef3eedb0007119cdb5ef516fa63cb57 -- mlir/test/lib/Dialect/Test/TestNamedAttrs.h mlir/test/lib/IR/TestNamedAttrs.cpp mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp mlir/test/lib/Dialect/Test/TestAttributes.h mlir/tools/mlir-opt/mlir-opt.cpp
``````````

</details>

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

``````````diff
diff --git a/mlir/test/lib/IR/TestNamedAttrs.cpp b/mlir/test/lib/IR/TestNamedAttrs.cpp
index f1167dead4..aa4701a544 100644
--- a/mlir/test/lib/IR/TestNamedAttrs.cpp
+++ b/mlir/test/lib/IR/TestNamedAttrs.cpp
@@ -1,4 +1,5 @@
-//===- TestNamedAttrs.cpp - Test passes for MLIR types -------------------------===//
+//===- TestNamedAttrs.cpp - Test passes for MLIR types
+//-------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -6,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "TestDialect.h"
 #include "TestAttributes.h"
+#include "TestDialect.h"
 #include "mlir/Pass/Pass.h"
 
 using namespace mlir;
@@ -52,7 +53,7 @@ struct TestNamedAttrsPass
       }
       return;
     }
-    
+
     if (funcName.contains("f_lookup_attr")) {
       func.walk([&](Operation *op) {
         if (test::TestNamedIntAttr::lookupValue(op)) {
@@ -64,7 +65,7 @@ struct TestNamedAttrsPass
       });
       return;
     }
-    
+
     if (funcName.contains("f_set_attr")) {
       if (!test::TestNamedIntAttr::has(func)) {
         auto intTy = IntegerType::get(func.getContext(), 32);
@@ -76,7 +77,7 @@ struct TestNamedAttrsPass
       }
       return;
     }
-    
+
     // Unknown key.
     func.emitOpError() << "unexpected function name";
     signalPassFailure();
@@ -87,9 +88,7 @@ struct TestNamedAttrsPass
 namespace mlir {
 namespace test {
 
-void registerTestNamedAttrsPass() {
-  PassRegistration<TestNamedAttrsPass>();
-}
+void registerTestNamedAttrsPass() { PassRegistration<TestNamedAttrsPass>(); }
 
 } // namespace test
 } // namespace mlir

``````````

</details>


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


More information about the Mlir-commits mailing list