[PATCH] D94002: [LangRef] Make lifetime intrinsic's semantics consistent with StackColoring's comment
Juneyoung Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 5 22:53:11 PST 2021
aqjune added a comment.
In D94002#2606307 <https://reviews.llvm.org/D94002#2606307>, @nlopes wrote:
> In D94002#2606276 <https://reviews.llvm.org/D94002#2606276>, @RalfJung wrote:
>
>>> The exact semantics of lifetime.start depends on the pattern matching patterns in the stack coloring algorithm. So this intrinsic cannot be abused. It must be used for the uses it was created for only.
>>
>> That's fair, but then shouldn't the docs say that? Usually one would expect the docs to say everything there is to be said; so in this case a dedicated warning might be in order to document the caveats you just mentioned.
>
> Ok, agreed! Let's make that explicit in the document.
I'll make a super small patch that adds this sentence. :)
================
Comment at: llvm/docs/LangRef.rst:17885
+a stack object that is already alive, it simply fills all bytes of the object
+with ``poison``.
+
----------------
RalfJung wrote:
> So when `ptr` is a pointer to a stack-allocated object at offset 4, then *all bytes* of the object, including the ones at offset 0-3, will become `poison`?
Yes, it was chosen to make all bytes poison; the first argument wasn't used because the description is saying it is the size of the *object*.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94002/new/
https://reviews.llvm.org/D94002
More information about the llvm-commits
mailing list