[PATCH] D63525: LangRef: Attempt to formulate some rules for addrspacecast

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 16:05:32 PDT 2019


arsenm created this revision.
arsenm added reviewers: reames, sanjoy.
Herald added a subscriber: wdng.
arsenm added a reviewer: theraven.

If agreed, some work will be needed to comply with these rules.


https://reviews.llvm.org/D63525

Files:
  docs/LangRef.rst


Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -9689,9 +9689,19 @@
 ``ptrval`` to type ``pty2``. It can be a *no-op cast* or a complex
 value modification, depending on the target and the address space
 pair. Pointer conversions within the same address space must be
-performed with the ``bitcast`` instruction. Note that if the address space
-conversion is legal then both result and operand refer to the same memory
-location.
+performed with the ``bitcast`` instruction. Note that if the address
+space conversion is legal then both result and operand refer to the
+same memory location. The conversion must have no side effects, or
+capture the value of the pointer.
+
+If the source is :ref:`poison <poisonvalues>`, the result is
+:ref:`poison <poisonvalues>`.
+
+If the source is not :ref:`poison <poisonvalues>`, and both source and
+destination address spaces are :ref:`integral pointers
+<nointptrtype>`, the cast is assumed to be reversible (i.e. casting
+the result back to the original address space should yield the
+original bit pattern).
 
 Example:
 """"""""


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63525.205461.patch
Type: text/x-patch
Size: 1165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190618/21917f7e/attachment.bin>


More information about the llvm-commits mailing list