rjmccall added a comment.

In https://reviews.llvm.org/D27680#629182, @ahatanak wrote:

> In https://reviews.llvm.org/D27680#628272, @rjmccall wrote:
>
> > Wouldn't it be simpler to just record an insertion point for the beginning 
> > of the current lexical scope and insert the lifetime.begin there instead of 
> > at the current IP?
>
>
> I'm not sure I understood your comment, but it seems to me that simply moving 
> the lifetime.start intrinsics to the current lexical scope wouldn't work in a 
> case like this:


I'm suggesting that, instead of moving instructions retroactively when you see 
a goto, you just insert the lifetime.start intrinsics at the start of the 
current lexical scope when you're emitting the variable.  That more exactly 
models the C language rule, I think, and shouldn't have any significant 
negative impact on optimization.


https://reviews.llvm.org/D27680



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to