[PATCH] [OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.

Alexey Bataev a.bataev at hotmail.com
Thu Nov 27 00:54:20 PST 2014


Hi rjmccall, ejstotzer, fraggamuffin,

"omp atomic read [seq_cst]" accepts expressions "v=x;". In this patch we perform an atomic load of "x" (using builtin atomic loading instructions or a call to "atomic_load()" for simple lvalues and "__kmpc_atomic_start();load <x>;__kmpc_atomic_end();" for other lvalues), convert the result of loading to type of "v" (using EmitScalarConversion() for simple types and EmitComplexToScalarConversion() for conversions from complex to scalar) and then store the result in "v".

http://reviews.llvm.org/D6431

Files:
  lib/CodeGen/CGAtomic.cpp
  lib/CodeGen/CGOpenMPRuntime.cpp
  lib/CodeGen/CGOpenMPRuntime.h
  lib/CodeGen/CGStmtOpenMP.cpp
  test/OpenMP/atomic_read_codegen.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6431.16670.patch
Type: text/x-patch
Size: 15148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141127/bfac71cf/attachment.bin>


More information about the cfe-commits mailing list