[PATCH] D124724: [Clang][OpenMP] Add the support for floating-point variables for specific atomic clauses

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 30 19:13:14 PDT 2022


tianshilei1992 created this revision.
tianshilei1992 added reviewers: ABataev, jdoerfert.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
tianshilei1992 requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

Currently when using `atomic update` with floating-point variables, if
the operation is add or sub, `cmpxchg`, instead of `atomicrmw` is emitted, as
shown in [1].  In fact, about three years ago, llvm-svn: 351850 added the
support for FP operations. This patch adds the support in OpenMP as well.

[1] https://godbolt.org/z/M7b4ba9na


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124724

Files:
  clang/lib/CodeGen/CGStmtOpenMP.cpp
  clang/test/OpenMP/atomic_capture_codegen.cpp
  clang/test/OpenMP/atomic_update_codegen.cpp
  clang/test/OpenMP/for_reduction_codegen.cpp
  clang/test/OpenMP/parallel_reduction_codegen.cpp
  clang/test/OpenMP/reduction_implicit_map.cpp
  clang/test/OpenMP/sections_reduction_codegen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124724.426260.patch
Type: text/x-patch
Size: 94677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220501/172f49fd/attachment-0001.bin>


More information about the cfe-commits mailing list