This is the mail archive of the
gsl-discuss@sourceware.org
mailing list for the GSL project.
Re: Optimizing calls to GSL functions
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Tommy Nordgren <tommy dot nordgren at comhem dot se>
- Cc: gsl-discuss at sourceware dot org
- Date: Sat, 09 Jun 2007 09:19:18 +0100
- Subject: Re: Optimizing calls to GSL functions
- References: <99A869CA-EE7B-410A-AF22-D3D1952A62B6@comhem.se>
At Sat, 9 Jun 2007 04:25:55 +0200,
Tommy Nordgren wrote:
> Are there any way, when using the GNU Compiler Collection, to make
> the compiler optimize expressions where the same function call
> occurs more than once. (Same function, same parameters) GCC does
> this for standard C functions such as cos and sin, when passed -O3
> or -Os -fgcse I'm interested in this, because most special functions
> computed by GSL are probably more expensive to compute than the
> basic transcendental functions, and in general you can get many
> common subexpressions when generating C code from symbol math
> programs.
__attribute__ ((pure), see "Function attributes" in the GCC manual for
details.
--
Brian Gough