diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-23 06:35:10 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-23 06:35:10 +0000 |
commit | 98cb5a7c84db57cfe01069eaa890f83b0124e8e4 (patch) | |
tree | 6af14c6924cfeb5719a20bf687a8a2381f7b3fb5 /test/OpenMP/atomic_messages.cpp | |
parent | 24003c1df297a7aabc667f616e8d7e1481a305c0 (diff) |
[OPENMP] Codegen for 'atomic capture'.
Adds codegen for 'atomic capture' constructs with the following forms of expressions/statements:
v = x binop= expr;
v = x++;
v = ++x;
v = x--;
v = --x;
v = x = x binop expr;
v = x = expr binop x;
{v = x; x = binop= expr;}
{v = x; x++;}
{v = x; ++x;}
{v = x; x--;}
{v = x; --x;}
{x = x binop expr; v = x;}
{x binop= expr; v = x;}
{x++; v = x;}
{++x; v = x;}
{x--; v = x;}
{--x; v = x;}
{x = x binop expr; v = x;}
{x = expr binop x; v = x;}
{v = x; x = expr;}
If x and expr are integer and binop is associative or x is a LHS in a RHS of the assignment expression, and atomics are allowed for type of x on the target platform atomicrmw instruction is emitted.
Otherwise compare-and-swap sequence is emitted.
Update of 'v' is not required to be be atomic with respect to the read or write of the 'x'.
bb:
...
atomic load <x>
cont:
<expected> = phi [ <x>, label %bb ], [ <new_failed>, %cont ]
<desired> = <expected> binop <expr>
<res> = cmpxchg atomic &<x>, desired, expected
<new_failed> = <res>.field1;
br <res>field2, label %exit, label %cont
exit:
atomic store <old/new x>, <v>
...
Differential Revision: http://reviews.llvm.org/D9049
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/atomic_messages.cpp')
-rw-r--r-- | test/OpenMP/atomic_messages.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/test/OpenMP/atomic_messages.cpp b/test/OpenMP/atomic_messages.cpp index 7466509b27..7306814163 100644 --- a/test/OpenMP/atomic_messages.cpp +++ b/test/OpenMP/atomic_messages.cpp @@ -672,7 +672,6 @@ int capture() { #pragma omp atomic capture capture b = a /= b; - // expected-note@+1 {{in instantiation of function template specialization 'capture<int>' requested here}} return capture<int>(); } |