[flang-commits] [flang] [flang][OpenMP] Handle conflicts between REQUIRES and ATOMIC restrict… (PR #163805)

via flang-commits flang-commits at lists.llvm.org
Thu Oct 16 08:31:19 PDT 2025


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 origin/main HEAD --extensions cpp -- flang/lib/Lower/OpenMP/Atomic.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/flang/lib/Lower/OpenMP/Atomic.cpp b/flang/lib/Lower/OpenMP/Atomic.cpp
index 58df5fdb3..4d45fe5e7 100644
--- a/flang/lib/Lower/OpenMP/Atomic.cpp
+++ b/flang/lib/Lower/OpenMP/Atomic.cpp
@@ -231,10 +231,10 @@ getAtomicMemoryOrder(semantics::SemanticsContext &semaCtx,
 static std::optional<mlir::omp::ClauseMemoryOrderKind>
 makeValidForAction(std::optional<mlir::omp::ClauseMemoryOrderKind> memOrder,
                    int action0, int action1, unsigned version) {
-// When the atomic default memory order specified on a REQUIRES directive is
-// disallowed on a given ATOMIC operation, and it's not ACQ_REL, the order
-// reverts to RELAXED. ACQ_REL decays to either ACQUIRE or RELEASE, depending
-// on the operation.
+  // When the atomic default memory order specified on a REQUIRES directive is
+  // disallowed on a given ATOMIC operation, and it's not ACQ_REL, the order
+  // reverts to RELAXED. ACQ_REL decays to either ACQUIRE or RELEASE, depending
+  // on the operation.
 
   if (!memOrder) {
     return memOrder;
@@ -251,7 +251,8 @@ makeValidForAction(std::optional<mlir::omp::ClauseMemoryOrderKind> memOrder,
   if (action == Analysis::Read) {
     // "acq_rel" decays to "acquire"
     if (*memOrder == mlir::omp::ClauseMemoryOrderKind::Acq_rel)
-      return mlir::omp::ClauseMemoryOrderKind::Acquire;;
+      return mlir::omp::ClauseMemoryOrderKind::Acquire;
+    ;
   } else if (action == Analysis::Write) {
     // "acq_rel" decays to "release"
     if (*memOrder == mlir::omp::ClauseMemoryOrderKind::Acq_rel)

``````````

</details>


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


More information about the flang-commits mailing list