summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorKristina Brooks <notstina@gmail.com>2019-02-26 18:53:13 +0000
committerKristina Brooks <notstina@gmail.com>2019-02-26 18:53:13 +0000
commit76eb4b02d93b3a7704b496f3e16dd14bf72cb3a9 (patch)
tree264077ce459366c9a72b81af299e25036cd48e1e /llvm/docs
parentf38b0053211886f130b5a0c4f1c312a0fff519b6 (diff)
downloadbcm5719-llvm-76eb4b02d93b3a7704b496f3e16dd14bf72cb3a9.tar.gz
bcm5719-llvm-76eb4b02d93b3a7704b496f3e16dd14bf72cb3a9.zip
Update docs of memcpy/move/set wrt. align and len
Fix https://bugs.llvm.org/show_bug.cgi?id=38583: Describe how memcpy/memmove/memset behave when len=0. Also fix some fallout from when the alignment parameter was replaced by an attribute. This closes PR38583. Patch by RalfJung (Ralf) Differential Revision: https://reviews.llvm.org/D57600 llvm-svn: 354911
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/LangRef.rst26
1 files changed, 19 insertions, 7 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 6af6ddfb3f2..9b81c6391a4 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -1071,10 +1071,11 @@ Currently, only the following parameter attributes are defined:
``align <n>``
This indicates that the pointer value may be assumed by the optimizer to
- have the specified alignment.
+ have the specified alignment. If the pointer value does not have the
+ specified alignment, behavior is undefined.
Note that this attribute has additional semantics when combined with the
- ``byval`` attribute.
+ ``byval`` attribute, which are documented there.
.. _noalias:
@@ -11325,8 +11326,11 @@ Semantics:
The '``llvm.memcpy.*``' intrinsics copy a block of memory from the
source location to the destination location, which are not allowed to
overlap. It copies "len" bytes of memory over. If the argument is known
-to be aligned to some boundary, this can be specified as the fourth
-argument, otherwise it should be set to 0 or 1 (both meaning no alignment).
+to be aligned to some boundary, this can be specified as an attribute on
+the argument.
+
+If "len" is 0, the pointers may be NULL or dangling. However, they must still
+be appropriately aligned.
.. _int_memmove:
@@ -11380,8 +11384,11 @@ Semantics:
The '``llvm.memmove.*``' intrinsics copy a block of memory from the
source location to the destination location, which may overlap. It
copies "len" bytes of memory over. If the argument is known to be
-aligned to some boundary, this can be specified as the fourth argument,
-otherwise it should be set to 0 or 1 (both meaning no alignment).
+aligned to some boundary, this can be specified as an attribute on
+the argument.
+
+If "len" is 0, the pointers may be NULL or dangling. However, they must still
+be appropriately aligned.
.. _int_memset:
@@ -11431,7 +11438,12 @@ Semantics:
""""""""""
The '``llvm.memset.*``' intrinsics fill "len" bytes of memory starting
-at the destination location.
+at the destination location. If the argument is known to be
+aligned to some boundary, this can be specified as an attribute on
+the argument.
+
+If "len" is 0, the pointers may be NULL or dangling. However, they must still
+be appropriately aligned.
'``llvm.sqrt.*``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^
OpenPOWER on IntegriCloud