[LLVMdev] [cfe-dev] [PROPOSAL] per-function optimization level control

Andrea_DiBiagio at sn.scee.net Andrea_DiBiagio at sn.scee.net
Fri Jun 14 04:06:13 PDT 2013


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.

We discussed this proposal with a number of people at the recent Bay Area 
social and agreed to submit a new proposal which should be much simpler 
and smaller in scope to let us achieve our primary use case by adding a 
function attribute (something like: "optnone").
Hopefully I'll post this on the list early next week.

Thanks,
Andrea Di Biagio
SN Systems - Sony Computer Entertainment Group

**********************************************************************
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 llvm-dev mailing list