ChuanqiXu added a comment.

Only one problem I had for emitting lifetime markers even at O0 is that would 
action make allocas to be optimized even at O0? If so, I wonder if it confuses 
programmers since they may find some variables disappear surprisingly. Or there 
would be no optimization since every function would be marked with option 
attribute. I am not sure about this.

If I understand this problem correctly, this patch could fix problems for the 
return value of symmetric transfer and the gro that we discussed in D98638 
<https://reviews.llvm.org/D98638>. Then D98638 
<https://reviews.llvm.org/D98638> may be unneeded. I prefer the implementation 
in this patch.



================
Comment at: clang/lib/CodeGen/CGDecl.cpp:1318
 /// otherwise
 llvm::Value *CodeGenFunction::EmitLifetimeStart(uint64_t Size,
                                                 llvm::Value *Addr) {
----------------
Can we sure frontend would always call this API to emit lifetime start? I mean 
the frontend may call EmitIntrinsic or create lifetime.start intrinsic directly 
whether by IRBuilder::CreateXXX or Instrinsic::Create(...). I worry about if 
this would incur changes out of design.

Then if we add check in EmitLifetimeStart, why not we add check in 
EmitLfietimeEnd?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99227

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

Reply via email to