yaxunl added a comment.

In https://reviews.llvm.org/D50104#1184362, @scott.linder wrote:

> Address feedback; I hope I understood correctly what debug info to check for.
>
> I don't see where in CreateMemTemp and friends EmitLifetimeStart gets called, 
> and I don't see any lifetime intrinsics in the IR even at -O1.


Emitting lifetime intrinsic is optional. In this case, since the life time of 
the temp var is just before and after the function call, emitting lifetime 
intrinsics can help optimizers.

It can be done by code like this:

   if (auto *Size = EmitLifetimeStart(
           CGM.getDataLayout().getTypeAllocSize(Alloca.getElementType()),
           Alloca.getPointer())) {
     pushFullExprCleanup<CallLifetimeEnd>(NormalEHLifetimeMarker, Alloca,
                                            Size);
  }

Then the lifetime.start should be emitted before the function call and 
lifetime.end should be emitted just after the function call.


https://reviews.llvm.org/D50104



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

Reply via email to