This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiler Analysis: 3.3, 3.4, or tree-ssa?


On Sat, 18 Oct 2003, Scott Robert Ladd wrote:

> Matt Fago wrote:
> >> The -O1, -O2, and -O3 options are general-purpose choices for 
> >> producing good code in general circumstances.
> > 
> > Are they? How is this determined?
> 
> I'll amend my statement...
> 
> "The -O1, -O2, and -O3 options *SHOULD BE* general-purpose choices for 
> producing good code in general circumstances."
> 
> > I think Acovea might allow the flags implied by these options to be 
> > chosen in a more quantitative way. Obviously Acovia should give better 
> > results when used with a specific code of interest.
> 
> I note that on some experiments, -O2 and -O3 produce *slower* code than 
> does -O1; and in several cases, Acovea finds options sets that produce 
> code which runs in 40% less time than it does when compiled with any of 
> the predefined optimization sets.
>
> We could define variations on the -O?? theme... -Ofp, for example, that 
> optimizes for floating-point applications.

IMHO, it will be more efficient to determine the optimization problem in
the compiler and fix it, instead of requiring everyone to waste CPU cycles
by running a genetic optimizer.

This isn't meant to denigrate your optimizer; it's merely to point out
that it's most useful as a compiler development tool to identify
optimization problems rather than as a end-user optimization tool.

The problem is that you're using this tool to identify the problem, then
avoid it. What we should be doing with it is to identify the problem and
fix it.

So, I hereby reextend my offer to lend my code analysis skills to peruse
your testcases (and the outputs thereof) to identify the compiler problems
which result in slower code at -O2 and -O3 optimization levels.

If you can send me the source code and the resultant assembly code for the
"slow" and "fast" compiler options, I will take a look at it.

Toshi







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]