]> granicus.if.org Git - clang/commit
[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)
commit515d33a57cd79e8bfc13c657abcb445a76243ffb
tree6c8f53e227e5af6595aa4dcf4af9ffd6cf06becd
parent842356e0cbf0dca8658278060214925bf413171a
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226784 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGAtomic.cpp
lib/CodeGen/CGStmtOpenMP.cpp
lib/Sema/SemaType.cpp
test/OpenMP/atomic_read_codegen.c [new file with mode: 0644]