[Openmp-commits] [PATCH] D65868: [OpenMP] Remove workaround for CMPXCHG

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 7 06:41:01 PDT 2019


Hahnfeld created this revision.
Hahnfeld added reviewers: AndreyChurbanov, jlpeyton.
Herald added subscribers: openmp-commits, jfb, guansong, mgorny.
Herald added a reviewer: jdoerfert.
Herald added a project: OpenMP.

GCC complains that 'cmp' in OP_CMPXCHG_WORKAROUND is not initialized.
I think this is wrong because it is written to through the pointer
in 'vvv'. However, the workaround is dated 2007 (we're in 2019!) and
was supposed to be fixed in version 11.0 of the compiler, so I think
the easiest solution is to just remove the old code.

I looked at the generated assembly of __kmpc_atomic_cmplx4_add / _sub
and it looks the same as __kmpc_atomic_float8_add except that cmplx4 are
two single precision values while float8 is one double precision value.
I also verified the result of a small Fortran program that atomically
adds to a shared complex(kind=4) variable in a parallel region.
The code in __kmpc_atomic_cmplx4_mul / _div also seems to load the
volatile variable which was the problem cited in the comment above
the workaround. All in all, I think this bug is no more.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65868

Files:
  openmp/runtime/cmake/LibompHandleFlags.cmake
  openmp/runtime/src/kmp_atomic.cpp
  openmp/runtime/src/kmp_os.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65868.213864.patch
Type: text/x-patch
Size: 8889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190807/0b6dee38/attachment-0001.bin>


More information about the Openmp-commits mailing list