[PATCH] D94002: [LangRef] Make lifetime intrinsic's semantics consistent with StackColoring's comment
Ralf via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 11 04:12:49 PST 2021
RalfJung added inline comments.
================
Comment at: llvm/docs/LangRef.rst:17837
+If ``ptr`` is syntactically pointing to at least one non-stack-allocated object,
+or the object it points to is unknown, it is equivalent to
+'``memset(ptr, undef, size)``'. If ``size`` is -1, it is equivalent to
----------------
So this means if LLVM becomes smarter, and "what does this point to" changes from "unknown" to "this set of allocas", that could actually introduce UB because "lifetime.start" semantics changes from "memset(undef)" to "the alloca is initially dead and only becomes life at this marker". Did I understand this correctly? If yes, that seems quite problematic from a user perspective -- how can I make sure that my code does not have UB, if that depends on how "smart" LLVM's analysis is?
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