[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:40:16 PST 2021


aqjune added inline comments.


================
Comment at: llvm/docs/LangRef.rst:18127
+the stack coloring algorithm cannot conclude that ``ptr`` is a stack-allocated
+object.
 
----------------
RalfJung wrote:
> aqjune wrote:
> > RalfJung wrote:
> > > Would this alternatively be captured by saying that if ptr is a stack-allocated object, then it *might* have the effect of the original `alloca` creating a dead object and this intrinsic making it live (but non-deterministically, not doing this and just replacing the content by poison is also allowed)?
> > It will help remove the mentioning of dependency on stack coloring's implementation, but due to practical reasons I think the current text is better.
> > 
> > It's because the current text reveals the problem of the status quo: alloca's lifetime depends on the stack coloring's implementation.
> > I think this mentioning will help people in the future raise questions about removal of this dependency, if lucky enough. Since this isn't a small problem, fully resolving this would require a dedicated team... I don't know.
> > 
> > Also, personally I prefer being simple here; nondeterminism is a hard concept and there's an opportunity that it can be interpreted differently by readers.
> As you wish. But then I'd probably weaken the statement earlier in this text where it says that 
> 
> ```
> If ``ptr`` is a stack-allocated object and it points to the first byte of
> the object, the object is initially marked as dead.
> After '``llvm.lifetime.start``', the stack object that ``ptr`` points is marked
> as alive and has an uninitialized value.
> ```
> Currently, this statement is first made only to be later partially revised; that seems confusing.
To minimize touching existing text, I moved it just after the sentence.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98112/new/

https://reviews.llvm.org/D98112



More information about the llvm-commits mailing list