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 | 5e018f9e29a2b7e67e82dfa17f32662f18a9bdf7 (patch) | |
tree | 1076e98ec3521274c55a0da81e8ca2f8542305da /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | 96183f6b0659c036100ce4718d219ceb43a82edd (diff) | |
download | bcm5719-llvm-5e018f9e29a2b7e67e82dfa17f32662f18a9bdf7.tar.gz bcm5719-llvm-5e018f9e29a2b7e67e82dfa17f32662f18a9bdf7.zip |
[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
llvm-svn: 235573
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
0 files changed, 0 insertions, 0 deletions