[cfe-dev] [LLVMdev] [PROPOSAL] per-function optimization level control
Xinliang David Li
xinliangli at gmail.com
Fri Jun 14 10:36:49 PDT 2013
On Fri, Jun 14, 2013 at 4:06 AM, <Andrea_DiBiagio at sn.scee.net> wrote:
> Hi David,
>
>> Regarding Andrea's proposal -- the new #pragma can be useful (in rare
>> cases when there is a compiler bug), the intended use cases are
>> questionable:
>> 1) it should not be used as a mechanism to triage compiler bugs -- the
>> compiler backend should have mechanism to allow any pass to be
>> disabled for any (range of) function(s) via command line options so
>> that it can be automated -- you should not expect doing this via
>> source modification
>> 2) Improve debuggability of optimized code. GCC has -Og option that
>> can be used to generate well optimized code with good debuggability.
>> 3) there is a much bigger issue if the customer needs to resort to
>> this pragmas frequently to hide optimizer bugs.
>
> Just to clarify, although in our opinion the ability to workaround
> optimization
> bugs is a useful side effect of this proposal, we don't consider it the
> main
> use case.
> That's probably my fault, I should have put more emphasis on the main use
> case:
>
> "The main motivation of our customers is to be able to selectively disable
> optimizations when debugging one function in a compilation unit, in the
> case
> where compiling the whole unit at -O0 would make the program run too
> slowly."
>
> In general, it is something that should help improve the debugging
> experience when customers have to debug specific portions of their code
> without sacrificing any of their overall runtime performances.
> As a side note, using GCC is not a option for us.
>
To be clear, I am not advocating GCC at all here. Just pointing out
there is room for improvement for DOC so that user does not need to
resort to these workarounds. I know Eric Christopher is working very
hard to make this happen for LLVM :)
thanks,
David
> **********************************************************************
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify postmaster at scee.net
> This footnote also confirms that this email message has been checked for
> all known viruses.
> Sony Computer Entertainment Europe Limited
> Registered Office: 10 Great Marlborough Street, London W1F 7LP, United
> Kingdom
> Registered in England: 3277793
> **********************************************************************
>
> P Please consider the environment before printing this e-mail
More information about the cfe-dev
mailing list