[PATCH] D21723: [RFC] Enhance synchscope representation

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 10:55:24 PDT 2017


t-tye added inline comments.


================
Comment at: docs/LangRef.rst:2192
+``<target-scope>`` is a target specific synchronization scope, then it is target
+dependent if it definitely does, definitely does not, or maybe
+*synchronizes with*, and participates in the seq\_cst total orderings of, other
----------------
sanjoy wrote:
> t-tye wrote:
> > sanjoy wrote:
> > > This middle paragraph was not clear to me.  Are you trying to say that given two atomic operations `op0` marked with `syncscope("scope-0")` and `op1` marked with `syncscope("scope-1")`, whether they synchronize or not is a target  specific function of `"scope-0"` and `"scope-1"`?  If so, why not say just that?
> > > 
> > It is actually also target dependent even if `scope-0` is the same as `scope-1`. The intend of the text was to convey that it may be possible to determine if two atomic operations definitely do synchronize, definitely do not, or may synchronize as suggested by @mehdi_amini in an earlier comment.
> > 
> > However, would the following be better?
> > 
> > ```
> > If an atomic operation is marked ``syncscope("<target-scope>")``, where
> > ``<target-scope>`` is a target specific synchronization scope, then it is target
> > dependent if it *synchronizes with*, and participates in the seq\_cst total orderings of, other atomic operations.
> > ```
> > 
> That sounds better to me.
> 
> I'd also like you to please clarify what exactly you mean by "synchronizes with" -- is this the "synchronizes with" relation used in the C++ memory model or something different?
Yes it is the same term as used in the C++ memory model and defined in [[ http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations | Memory Model for Concurrent Operations]]. The term is also being used elsewhere in this section to describe acquire and release etc.


https://reviews.llvm.org/D21723





More information about the llvm-commits mailing list