This is the mail archive of the
mailing list for the GCC project.
Re: why not consfold sin(const)
- From: Luchezar Belev <l_belev at yahoo dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 19 Sep 2004 12:14:29 -0700 (PDT)
- Subject: Re: why not consfold sin(const)
Robert Dewar wrote:
> Generally speaking in compiler-development-land, far too much effort
> goes into optimizations that have no measureable significant value.
> So the best argument for a given optimization is to show a real program
> where the optimization would make a real difference.
> I remember from SPITBOL times that many people would write to us
> suggesting an optimization. We then imposed a rule that we would
> only publish such suggestions in the newsletter if they were
> accompanied by a sample program where the optimization would
> speed things up at least a few percent. The flow of suggestions
> completely dried up :-)
OK, but in our concrete case we already have some optimizing logic in place
which looks if the argument of sin() is zero or if the argument of log() is one,
and in the case of sqrt always replaces with const. So if this already present
logic is worth enough to be there in the compiler, i fail to see why a full consfolder
is not worth enough. It's definitely not the case that it's something too complex
for implementing. In fact it's exactly as complex as the currently present logic.
Surely the precision is not much of an issue either, since -ffast-math
implies possible non-strict copliance with standards, precision requirements, etc.
Do you Yahoo!?
Declare Yourself - Register online to vote today!