[PATCH] D93376: [LangRef] Clarify the semantics of lifetime intrinsics

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 00:17:07 PST 2020


aqjune added a comment.

In D93376#2457117 <https://reviews.llvm.org/D93376#2457117>, @lebedev.ri wrote:

> I'm unconvinced. Some questions:
>
> 1. Why can't it point at a subset of an allocation?
> 2. Why is it being restricted to an `alloca`, why shouldn't it be used for heap allocations?

I think answers to these questions are somewhat related to the goal of these intrinsics. IIUC, they are introduced to represent lifetimes of local variables while keeping allocas at the entry block in IR.
Either a local variable is within the scope or not, but not only a portion of those are.
Heap allocation's lifetime can be explicitly described by the allocation call and free call.
Is there a use case where these two cases should be supported?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93376



More information about the llvm-commits mailing list