[PATCH] D70947: Add a default address space for globals to DataLayout

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 09:28:14 PST 2019


arichardson marked an inline comment as done.
arichardson added a comment.

In D70947#1767234 <https://reviews.llvm.org/D70947#1767234>, @arsenm wrote:

> Needs some bitcode compatibility tests, and actual uses. AMDGPU's data layout should also add -G1


That's great to know and should make it easier to write tests.

I was going to add uses in follow-up commits but if you prefer I can also include some in this change.



================
Comment at: llvm/docs/LangRef.rst:2059
+``G<address space>``
+    Specifies the address space that should be used for global variables.
+    If omitted, the globals address space defaults to the default address
----------------
arsenm wrote:
> The phrasing is a bit wrong. This implies for all global variables. This should maybe be the default address space for globals?
Possibly something like this? `Specifies the address space to be used by default when creating global variables. If omitted, the globals address space defaults to the default address space 0. Note: variable declarations without an address space are always created in address space 0, this property only affects the default value to be used when creating globals programmatically.`

I could probably also adjust the parser to use this value as a default but I'm not sure that is desirable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70947/new/

https://reviews.llvm.org/D70947





More information about the llvm-commits mailing list