[PATCH] D47859: [LangRef] insertelement/extractelement return poison for out of range.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 16:57:00 PDT 2018


efriedma created this revision.
efriedma added reviewers: nlopes, spatel, hfinkel.

We need to clarify the language here. I think poison makes more sense than undef, since it's an undefined operation rather than uninitialized memory.  I don't think anything depends on the difference at the moment, though.


Repository:
  rL LLVM

https://reviews.llvm.org/D47859

Files:
  docs/LangRef.rst


Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -7595,7 +7595,8 @@
 
 The result is a scalar of the same type as the element type of ``val``.
 Its value is the value at position ``idx`` of ``val``. If ``idx``
-exceeds the length of ``val``, the results are undefined.
+exceeds the length of ``val``, the result is a
+:ref:`poison value <poisonvalues>`.
 
 Example:
 """"""""
@@ -7636,8 +7637,8 @@
 
 The result is a vector of the same type as ``val``. Its element values
 are those of ``val`` except at position ``idx``, where it gets the value
-``elt``. If ``idx`` exceeds the length of ``val``, the results are
-undefined.
+``elt``. If ``idx`` exceeds the length of ``val``, the result
+is a :ref:`poison value <poisonvalues>`.
 
 Example:
 """"""""


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47859.150228.patch
Type: text/x-patch
Size: 841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180606/5b546954/attachment.bin>


More information about the llvm-commits mailing list