[LLVMdev] Proposal for a new LLVM concurrency memory model

Renato Golin rengolin at systemcall.org
Mon Apr 26 13:53:31 PDT 2010


On 26 April 2010 21:09, David Greene <dag at cray.com> wrote:
> Vector atomics are extremely useful on architectures that support them.
>
> I'm not sure we need atomicity across vector elements, so decomposing
> shouldn't be a problem, but I will have to think about it a bit.

What is the semantics for vectorization across atomic vector operations?

Suppose I atomically write in thread 1 and read in thread 2, to a
vector with 64 elements. If I do automatic vectorization, it'd naively
be converted into N operations of 64/N-wide atomically writes and
reads, but not necessarily reading block k on thread 2 would happen
before writing it on thread 1, supposing reads are much faster than
writes.

I suppose one would have to have great care when doing such
transformations, to keep the same semantics. For instance, splitting
in two loops and putting a barrier between them, thus back to the
original design.


cheers,
--renato

http://systemcall.org/

Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm



More information about the llvm-dev mailing list