From c6af5ead8696f066fd5ec2978b9fc071ddf88a42 Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Thu, 28 Jul 2016 23:43:38 +0000 Subject: [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 --- llvm/docs/LangRef.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'llvm/docs/LangRef.rst') 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`. 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:
:
:
...`` + This specifies pointer types with the specified address spaces + as :ref:`Non-Integral Pointer Type ` s. The ``0`` + address space cannot be specified as non-integral. On every specification that takes a ``:``, specifying the ```` alignment is optional. If omitted, the preceding ``:`` -- cgit v1.2.3