[flang-commits] [flang] [Flang] Minloc elemental intrinsic lowering (PR #74828)

via flang-commits flang-commits at lists.llvm.org
Fri Dec 8 03:27:57 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 c90cb6eee8296953c097fcc9fc6e61f739c0dad3 bbdb55b9b0937e75c83bee4309267a231befd7b1 -- flang/include/flang/Optimizer/Support/Utils.h flang/lib/Lower/HlfirIntrinsics.cpp flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
``````````

</details>

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

``````````diff
diff --git a/flang/include/flang/Optimizer/Support/Utils.h b/flang/include/flang/Optimizer/Support/Utils.h
index 93caa8b23d..e567a81b72 100644
--- a/flang/include/flang/Optimizer/Support/Utils.h
+++ b/flang/include/flang/Optimizer/Support/Utils.h
@@ -148,7 +148,6 @@ void genMinlocReductionLoop(fir::FirOpBuilder &builder, mlir::Value array,
                             mlir::Type maskElemType, mlir::Value resultArr,
                             bool maskMayBeLogicalScalar);
 
-
 } // namespace fir
 
 #endif // FORTRAN_OPTIMIZER_SUPPORT_UTILS_H
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp b/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
index 218ddd2a6a..f71f5bad91 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
@@ -721,9 +721,9 @@ public:
       return rewriter.notifyMatchFailure(
           assign, "Currently requires a boxed type input");
     mlir::Type elementType = hlfir::getFortranElementType(arrayType);
-  if (!fir::isa_trivial(elementType))
-    return rewriter.notifyMatchFailure(
-        assign, "Character arrays are currently not handled");
+    if (!fir::isa_trivial(elementType))
+      return rewriter.notifyMatchFailure(
+          assign, "Character arrays are currently not handled");
 
     auto init = [](fir::FirOpBuilder builder, mlir::Location loc,
                    mlir::Type elementType) {
@@ -743,8 +743,7 @@ public:
             fir::FirOpBuilder builder, mlir::Location loc,
             mlir::Type elementType, mlir::Value array, mlir::Value flagRef,
             mlir::Value reduction,
-            const llvm::SmallVectorImpl<mlir::Value> &indices)
-        -> mlir::Value {
+            const llvm::SmallVectorImpl<mlir::Value> &indices) -> mlir::Value {
       // We are in the innermost loop: generate the elemental inline
       mlir::Value oneIdx =
           builder.createIntegerConstant(loc, builder.getIndexType(), 1);
diff --git a/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp b/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
index c88b71baf2..1d7e092b61 100644
--- a/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
+++ b/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
@@ -31,8 +31,8 @@
 #include "flang/Optimizer/Dialect/FIRType.h"
 #include "flang/Optimizer/Dialect/Support/FIRContext.h"
 #include "flang/Optimizer/HLFIR/HLFIRDialect.h"
-#include "flang/Optimizer/Transforms/Passes.h"
 #include "flang/Optimizer/Support/Utils.h"
+#include "flang/Optimizer/Transforms/Passes.h"
 #include "flang/Runtime/entry-names.h"
 #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
 #include "mlir/IR/Matchers.h"
@@ -745,8 +745,7 @@ static void genRuntimeMinlocBody(fir::FirOpBuilder &builder,
       [&rank, &resultArr, &mask, &maskElemType, &maskRank](
           fir::FirOpBuilder builder, mlir::Location loc, mlir::Type elementType,
           mlir::Value array, mlir::Value flagRef, mlir::Value reduction,
-          const llvm::SmallVectorImpl<mlir::Value> &indices)
-      -> mlir::Value {
+          const llvm::SmallVectorImpl<mlir::Value> &indices) -> mlir::Value {
     // We are in the innermost loop: generate the reduction body.
     if (maskRank > 0) {
       mlir::Type logicalRef = builder.getRefType(maskElemType);

``````````

</details>


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


More information about the flang-commits mailing list