[flang-commits] [flang] [mlir] [mlir][OpenMP] - Transform target offloading directives for easier translation to LLVMIR (PR #83966)

via flang-commits flang-commits at lists.llvm.org
Wed May 1 22:02:34 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 71113047298ccb92e6c636a535f0f855a04ee0db 65c75541864e9c8bab5790e99c8a838dd59ec877 -- mlir/include/mlir/Dialect/OpenMP/Passes.h mlir/lib/Dialect/OpenMP/Transforms/OpenMPTaskBasedTarget.cpp mlir/include/mlir/InitAllPasses.h
``````````

</details>

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

``````````diff
diff --git a/mlir/lib/Dialect/OpenMP/Transforms/OpenMPTaskBasedTarget.cpp b/mlir/lib/Dialect/OpenMP/Transforms/OpenMPTaskBasedTarget.cpp
index 9f5b3f6dc7..29310d6093 100644
--- a/mlir/lib/Dialect/OpenMP/Transforms/OpenMPTaskBasedTarget.cpp
+++ b/mlir/lib/Dialect/OpenMP/Transforms/OpenMPTaskBasedTarget.cpp
@@ -32,8 +32,8 @@
 
 #include "mlir/Dialect/OpenMP/Passes.h"
 
-#include "mlir/Dialect/Func/IR/FuncOps.h"
 #include "mlir/Dialect/Arith/IR/Arith.h"
+#include "mlir/Dialect/Func/IR/FuncOps.h"
 #include "mlir/Dialect/OpenMP/OpenMPDialect.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include "llvm/Support/Debug.h"
@@ -74,9 +74,11 @@ public:
     // mlir::BoolAttr F = rewriter.getBoolAttr(false);
     omp::TaskOp taskOp = rewriter.create<omp::TaskOp>(
         op.getLoc(),
-        /*if_expr*/ op.getNowait() ?
-        rewriter.create<mlir::arith::ConstantOp>(op.getLoc(), i1Ty, rewriter.getIntegerAttr(i1Ty, 1))
-        : rewriter.create<mlir::arith::ConstantOp>(op.getLoc(), i1Ty, rewriter.getIntegerAttr(i1Ty, 0)),
+        /*if_expr*/ op.getNowait()
+            ? rewriter.create<mlir::arith::ConstantOp>(
+                  op.getLoc(), i1Ty, rewriter.getIntegerAttr(i1Ty, 1))
+            : rewriter.create<mlir::arith::ConstantOp>(
+                  op.getLoc(), i1Ty, rewriter.getIntegerAttr(i1Ty, 0)),
         /*final_expr*/ Value(),
         /*untied*/ UnitAttr(),
         /*mergeable*/ UnitAttr(),

``````````

</details>


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


More information about the flang-commits mailing list