[Openmp-commits] [PATCH] D94848: [OpenMP] Fix atomic entries for captured logical operation

Hansang Bae via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jan 15 16:57:04 PST 2021


hbae created this revision.
hbae added reviewers: AndreyChurbanov, tlwilmar, jlpeyton, Nawrin.
hbae added a project: OpenMP.
Herald added subscribers: jfb, guansong, yaxunl.
hbae requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

Added missing code for the captured atomic operation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94848

Files:
  openmp/runtime/src/kmp_atomic.cpp


Index: openmp/runtime/src/kmp_atomic.cpp
===================================================================
--- openmp/runtime/src/kmp_atomic.cpp
+++ openmp/runtime/src/kmp_atomic.cpp
@@ -2536,8 +2536,11 @@
                                                                                \
   if (flag) {                                                                  \
     new_value OP rhs;                                                          \
-  } else                                                                       \
+    (*lhs) = new_value;                                                        \
+  } else {                                                                     \
     new_value = (*lhs);                                                        \
+    (*lhs) OP rhs;                                                             \
+  }                                                                            \
                                                                                \
   __kmp_release_atomic_lock(&ATOMIC_LOCK##LCK_ID, gtid);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94848.317113.patch
Type: text/x-patch
Size: 1088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210116/c9eb1d42/attachment.bin>


More information about the Openmp-commits mailing list