[OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
authorAlexey Bataev <a.bataev@hotmail.com>
Thu, 22 Jan 2015 05:29:28 +0000 (05:29 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Thu, 22 Jan 2015 05:29:28 +0000 (05:29 +0000)
commit13c7c4930c9067c1e0639c8c938422a503480755
tree356b3c96b039cb3262bc53418093b9b395b40e38
parenta91745820385ca7cbeab2cfe1df15800703f619b
[OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
"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".
Differential Revision: http://reviews.llvm.org/D6431

llvm-svn: 226784
clang/lib/CodeGen/CGAtomic.cpp
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/Sema/SemaType.cpp
clang/test/OpenMP/atomic_read_codegen.c [new file with mode: 0644]