diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-07-28 23:43:38 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-07-28 23:43:38 +0000 |
commit | c6af5ead8696f066fd5ec2978b9fc071ddf88a42 (patch) | |
tree | 7f59237be705b684b8d92accac499f2c5d22a30b /llvm/docs/LangRef.rst | |
parent | aa3506c5f0b68624895e9643824a52dafaf8ab80 (diff) | |
download | bcm5719-llvm-c6af5ead8696f066fd5ec2978b9fc071ddf88a42.tar.gz bcm5719-llvm-c6af5ead8696f066fd5ec2978b9fc071ddf88a42.zip |
[IR] Introduce a non-integral pointer type
Summary:
This change adds a `ni` specifier in the `datalayout` string to denote
pointers in some given address spaces as "non-integral", and adds some
typing rules around these special pointers.
Reviewers: majnemer, chandlerc, atrick, dberlin, eli.friedman, tstellarAMD, arsenm
Subscribers: arsenm, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D22488
llvm-svn: 277085
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r-- | llvm/docs/LangRef.rst | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index d4d0ee325c9..7f69d693294 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -546,6 +546,26 @@ An example of an identified structure specification is: Prior to the LLVM 3.0 release, identified types were structurally uniqued. Only literal types are uniqued in recent versions of LLVM. +.. _nointptrtype: + +Non-Integral Pointer Type +------------------------- + +Note: non-integral pointer types are a work in progress, and they should be +considered experimental at this time. + +LLVM IR optionally allows the frontend to denote pointers in certain address +spaces as "non-integral" via the :ref:```datalayout`` +string<langref_datalayout>`. Non-integral pointer types represent pointers that +have an *unspecified* bitwise representation; that is, the integral +representation may be target dependent or unstable (not backed by a fixed +integer). + +``inttoptr`` instructions converting integers to non-integral pointer types are +ill-typed, and so are ``ptrtoint`` instructions converting values of +non-integral pointer types to integers. Vector versions of said instructions +are ill-typed as well. + .. _globalvars: Global Variables @@ -1831,6 +1851,10 @@ as follows: ``n32:64`` for PowerPC 64, or ``n8:16:32:64`` for X86-64. Elements of this set are considered to support most general arithmetic operations efficiently. +``ni:<address space0>:<address space1>:<address space2>...`` + This specifies pointer types with the specified address spaces + as :ref:`Non-Integral Pointer Type <nointptrtype>` s. The ``0`` + address space cannot be specified as non-integral. On every specification that takes a ``<abi>:<pref>``, specifying the ``<pref>`` alignment is optional. If omitted, the preceding ``:`` |