diff options
author | Dylan McKay <me@dylanmckay.io> | 2018-02-19 09:56:22 +0000 |
---|---|---|
committer | Dylan McKay <me@dylanmckay.io> | 2018-02-19 09:56:22 +0000 |
commit | ced2fe68f33d86ffdbd90be321761f7b0dab46c5 (patch) | |
tree | e89184d8872156b6e04dd8bbc55c4b566bf71a50 /llvm/docs | |
parent | e0ef348cb9c50d56be935e856c81e48cc1e744bd (diff) | |
download | bcm5719-llvm-ced2fe68f33d86ffdbd90be321761f7b0dab46c5.tar.gz bcm5719-llvm-ced2fe68f33d86ffdbd90be321761f7b0dab46c5.zip |
Add default address space for functions to the data layout (1/3)
Summary:
This adds initial support for letting targets specify which address
spaces their functions should reside in by default.
If a function is created by a frontend, it will get the default address space specified in the DataLayout, unless the frontend explicitly uses a more general `llvm::Function` constructor. Function address spaces will become a part of the bitcode and textual IR forms, as we do not have access to a data layout whilst parsing LL.
It will be possible to write IR that explicitly has `addrspace(n)` on a function. In this case, the function will reside in the specified space, ignoring the default in the DL.
This is the first step towards placing functions into the correct
address space for Harvard architectures.
Full patchset
* Add program address space to data layout D37052
* Require address space to be specified when creating functions D37054
* [clang] Require address space to be specified when creating functions D37057
Reviewers: pcc, arsenm, kparzysz, hfinkel, theraven
Reviewed By: theraven
Subscribers: arichardson, simoncook, rengolin, wdng, uabelho, bjope, asb, llvm-commits
Differential Revision: https://reviews.llvm.org/D37052
llvm-svn: 325479
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/LangRef.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 034a8669023..6999e8f55f8 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -1905,8 +1905,15 @@ as follows: must be a multiple of 8-bits. If omitted, the natural stack alignment defaults to "unspecified", which does not prevent any alignment promotions. +``P<address space>`` + Specifies the address space that corresponds to program memory. + Harvard architectures can use this to specify what space LLVM + should place things such as functions into. If omitted, the + program memory space defaults to the default address space of 0, + which corresponds to a Von Neumann architecture that has code + and data in the same space. ``A<address space>`` - Specifies the address space of objects created by '``alloca``'. + Specifies the address space of objects created by '``alloca``'. Defaults to the default address space of 0. ``p[n]:<size>:<abi>:<pref>:<idx>`` This specifies the *size* of a pointer and its ``<abi>`` and |