[PATCH] D98112: [LangRef] mention that the lifetime intrinsics' description in LangRef isn't everything
Juneyoung Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 6 23:37:25 PST 2021
aqjune updated this revision to Diff 328843.
aqjune added a comment.
Forward-declare the dependency on the stack coloring algorithm
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98112/new/
https://reviews.llvm.org/D98112
Files:
llvm/docs/LangRef.rst
Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -9369,6 +9369,12 @@
pointer may not be unique. The order in which memory is allocated (ie.,
which way the stack grows) is not specified.
+If the returned pointer is used by :ref:`llvm.lifetime.start <int_lifestart>`,
+the returned object is initially dead.
+See :ref:`llvm.lifetime.start <int_lifestart>` and
+:ref:`llvm.lifetime.end <int_lifeend>` for the precise semantics of
+lifetime-manipulating intrinsics.
+
Example:
""""""""
@@ -18099,6 +18105,10 @@
If ``ptr`` is a stack-allocated object and it points to the first byte of
the object, the object is initially marked as dead.
+``ptr`` is conservatively considered as a non-stack-allocated object if
+the stack coloring algorithm that is used in the optimization pipeline cannot
+conclude that ``ptr`` is a stack-allocated object.
+
After '``llvm.lifetime.start``', the stack object that ``ptr`` points is marked
as alive and has an uninitialized value.
The stack object is marked as dead when either
@@ -18114,7 +18124,6 @@
byte of the object or it is a stack object that is already alive, it simply
fills all bytes of the object with ``poison``.
-
.. _int_lifeend:
'``llvm.lifetime.end``' Intrinsic
@@ -18145,13 +18154,16 @@
If ``ptr`` is a stack-allocated object and it points to the first byte of the
object, the object is dead.
+``ptr`` is conservatively considered as a non-stack-allocated object if
+the stack coloring algorithm that is used in the optimization pipeline cannot
+conclude that ``ptr`` is a stack-allocated object.
+
Calling ``llvm.lifetime.end`` on an already dead alloca is no-op.
If ``ptr`` is a non-stack-allocated object or it does not point to the first
byte of the object, it is equivalent to simply filling all bytes of the object
with ``poison``.
-
'``llvm.invariant.start``' Intrinsic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98112.328843.patch
Type: text/x-patch
Size: 2002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210307/0ddcc239/attachment.bin>
More information about the llvm-commits
mailing list