[flang-commits] [flang] [flang] Add reductions for CUF Kernels: Lowering (PR #95184)

via flang-commits flang-commits at lists.llvm.org
Tue Jun 11 18:27:56 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 d9012d8775b45e3edc33394684050cf06b394fb0 66d96aaaa76dd92dd466f020560ac831099d9587 -- flang/lib/Lower/Bridge.cpp flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp
``````````

</details>

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

``````````diff
diff --git a/flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp b/flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp
index d32439c090..00b706fec9 100644
--- a/flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp
+++ b/flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp
@@ -13,8 +13,8 @@
 #include "flang/Optimizer/Dialect/CUF/CUFOps.h"
 #include "flang/Optimizer/Dialect/CUF/Attributes/CUFAttr.h"
 #include "flang/Optimizer/Dialect/CUF/CUFDialect.h"
-#include "flang/Optimizer/Dialect/FIRType.h"
 #include "flang/Optimizer/Dialect/FIRAttr.h"
+#include "flang/Optimizer/Dialect/FIRType.h"
 #include "mlir/IR/Attributes.h"
 #include "mlir/IR/BuiltinAttributes.h"
 #include "mlir/IR/BuiltinOps.h"
@@ -231,13 +231,13 @@ mlir::LogicalResult cuf::KernelOp::verify() {
   auto reduceAttrs = getReduceAttrs();
   std::size_t reduceAttrsSize = reduceAttrs ? reduceAttrs->size() : 0;
   if (getReduceOperands().size() != reduceAttrsSize)
-      return emitOpError("expect same number of values in reduce operands and "
-                         "reduce attributes");
+    return emitOpError("expect same number of values in reduce operands and "
+                       "reduce attributes");
   if (reduceAttrs) {
-      for (const auto &attr : reduceAttrs.value()) {
-          if (!mlir::isa<fir::ReduceAttr>(attr))
-              return emitOpError("expect reduce attributes to be ReduceAttr");
-      }
+    for (const auto &attr : reduceAttrs.value()) {
+      if (!mlir::isa<fir::ReduceAttr>(attr))
+        return emitOpError("expect reduce attributes to be ReduceAttr");
+    }
   }
   return mlir::success();
 }

``````````

</details>


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


More information about the flang-commits mailing list