[llvm-dev] Memory scope proposal

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 30 17:53:46 PDT 2016


Hi,

[Sorry for chiming in so late.]

I understand why a straightforward metadata scheme won't work here,
but have you considered an alternate scheme that works in the
following way:

   - We add a MD node called !nosynch that lists a set of "domains" a
     certain memory operation does *not* synchronize with.

   - Memory operations with !nosynch synchronize with memory operations
     without any !nosynch metadata (so dropping !nosynch is safe).

This will only work if your frontend knows, ahead of time, what the
possible set of synch-domains are, but it presumably already knows
that (otherwise how do you map domain names to integers)?

The other disadvantage with the scheme above is that memory operations
on the "normal CPU heap" (pardon my GPU n00b-ness here :) ) will synch
with the memory operations with !nosynch metadata.  However, we can
solve that by modeling the "normal CPU heap" as "!nosynch
!{!special_domain_a, !special_domain_b, ... all domains except
!cpu_heap_domain}".

Thanks,
-- Sanjoy


More information about the llvm-dev mailing list