[PATCH] D21723: [RFC] Enhance synchscope representation

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 13:59:57 PDT 2017


mehdi_amini added inline comments.


================
Comment at: include/llvm/Bitcode/LLVMBitCodes.h:381
+  /// First encoded value for target specific synchronization scope.
+  SYNCHSCOPE_FIRSTTARGETSPECIFIC = 2
 };
----------------
arsenm wrote:
> mehdi_amini wrote:
> > mehdi_amini wrote:
> > > if the plan is to be able to add new scopes (cf previous question), how is it supposed to be translated on the encoding side?
> > I think I mentioned in the past using target specific strings instead of integer in textual and bitcode serialization, why was this ruled out? This was intended to addressed such issues (and make the textual IR more readable)
> This was done and then reverted to this plan. I think using a string is overkill and would make the textual IR less readable. Other places in the IR that use string-like inputs refer to them through metadata nodes, which requires indirection to see what it actually is. As it is this isn't really different from target defined address space IDs today.
Can you explain how this:

```
 atomicrmw volatile xchg i32* %x, i32 10 syncscope(5) monotonic
```

is more readable than this:

```
 atomicrmw volatile xchg i32* %x, i32 10 syncscope("image") monotonic
```

?


https://reviews.llvm.org/D21723





More information about the llvm-commits mailing list