[PATCH] D97924: [LangRef] clarify the semantics of nocapture
Juneyoung Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 12 22:57:03 PDT 2021
aqjune marked an inline comment as done.
aqjune added a comment.
I updated this patch to address comments & added a few examples that I concern.
I hope this helps check whether my understanding about pointer capture is correct.
================
Comment at: llvm/docs/LangRef.rst:1206
- attribute for return values. Addresses used in volatile operations
- are considered to be captured.
----------------
I moved the volatile thing to the new section.
================
Comment at: llvm/docs/LangRef.rst:2647
+A pointer that is passed as a :ref:`nocapture <nocapture>` argument isn't
+escaped by the function call.
+
----------------
jdoerfert wrote:
> The first thing is not true, e.g., it ignores ptr2int.
Thank you. For correctness & clarity, I removed the paragraph.
================
Comment at: llvm/docs/LangRef.rst:2653
+and another not tagged as arguments, and callee can escape the untagged
+pointer.
+
----------------
jdoerfert wrote:
> I honestly don't understand this. For me, the beginning reads like: "If the pointer is nocapture it is captured when ...." which is at least odd. I assume you want to say that nocapture applies to the use and not the value, if so, let's do that more explicitly.
Yes, your understanding is right. I added a relevant example with `nocapture` at the nocapture paragraph.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97924/new/
https://reviews.llvm.org/D97924
More information about the llvm-commits
mailing list