This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Efficacy of optimizations.
- From: Scott Robert Ladd <coyote at coyotegulch dot com>
- To: kernel_learner <kernel_learner at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 01 Aug 2003 23:23:41 -0400
- Subject: Re: Efficacy of optimizations.
- References: <20030801210815.51773.qmail@web40304.mail.yahoo.com>
kernel_learner wrote:
1. What is the cost/benefit ratio of these optimizations.
The effectiveness of different optimizations is very dependent on the
style and substance of the source code; what may be beneficial for one
type of program can be detriment to another. Some optimizations only
make sense on certain hardware architectures.
2. How do these compiler optimizations interact? i.e. does one
optimization negate the effect of another optimization if done in a
particular order?
I've been studying this very issue, in reference to GCC, using a genetic
algorithm to evolve effective optimization options for several different
source codes. While I'm not ready to formally publish my findings, I
have identifed situations where different options conflict to pessimize
code.
The primary reason I haven't published my findings is that the results
are very application-specific. On certain programs, a carefully-selected
set of optimization options will produce faster code than can be
attained with "catch-all" options (-O1, -O2, and -O3). A generalization
of principles, however, still eludes me...
--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing