Committed @ r213379
Cheers, -- Arnaud From: [email protected] [mailto:[email protected]] On Behalf Of Arnaud A. de Grandmaison Sent: 18 July 2014 09:27 To: 'Reid Kleckner' Cc: [email protected] Subject: RE: [PATCH] Emit lifetime.start / lifetime.end markers for unnamed temporary objects Thanks for the review Reid. I will lift CallLifetimeEnd* to CGF and remove the duplication. Cheers, -- Arnaud A. de Grandmaison From: Reid Kleckner [mailto:[email protected]] Sent: 18 July 2014 00:12 To: Arnaud De Grandmaison Cc: [email protected] cfe Subject: Re: [PATCH] Emit lifetime.start / lifetime.end markers for unnamed temporary objects Looks good with a small change. I'm surprised we previously only did this for named variables. +namespace { +/// A cleanup to call @llvm.lifetime.end. +class CallLifetimeEndForUnnamed : public EHScopeStack::Cleanup { + llvm::Value *Addr; + llvm::Value *Size; + +public: + CallLifetimeEndForUnnamed(llvm::Value *addr, llvm::Value *size) + : Addr(addr), Size(size) {} + + void Emit(CodeGenFunction &CGF, Flags flags) override { + CGF.EmitLifetimeEnd(Size, Addr); + } +}; +} Can we avoid this duplication by adding and using CGF::pushLifetimeEndCleanup? On Thu, Jul 17, 2014 at 2:14 PM, Arnaud A. de Grandmaison <[email protected]> wrote: This will improve stack slot reuse in the LLVM optimizers, especially with C++ where it is so easy to have lots of those unnamed temporaries, with small live ranges. The lifetime markers are only inserted if the temporaries are big enough, using the same value than for named objects (32 bytes). In a second step, I plan to play with this value to see where we stand with respect to performances & compile time. Could someone familiar with CodeGen have a look at this patch ? Cheers, -- Arnaud A. de Grandmaison _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
