[PATCH] D21723: [RFC] Enhance synchscope representation

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 21:31:36 PDT 2017


tony-tye added a comment.

Just a wild thought:-) Since address spaces and memory scopes are both target defined concepts, it seems best for the target to define the enumeration of the ones it supports. Would it make sense for the data layout to not only give the properties of the address spaces, but also give their textual names, together with the textual names of the memory scopes supported by the target? The memory scopes would include the memory scope to use for singlethread and crossthread.

This way the target gets to enumerate the address spaces and memory scopes it supports, and provides the names that can be used in the textual dumps. The LLVM IR and bit code can use the target specific numeric values defined in the data layout. The target will then be able to define the numeric values it uses and not require any indirect mappings. Since the exact values are enumerated in the data layout a target can ensure that it supports the data layout. This also avoids using metadata, which is allowed to be deleted rendering it impossible for a target to know what the address spaces mean.

If not this then maybe something similar?


https://reviews.llvm.org/D21723





More information about the llvm-commits mailing list