This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimizing calling conventions for function return
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: "Jon Smirl" <jonsmirl at gmail dot com>
- Cc: "Geert Bosch" <bosch at adacore dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 25 May 2006 19:11:59 +0100
- Subject: Re: optimizing calling conventions for function return
In http://gcc.gnu.org/ml/gcc/2006-05/msg00604.html, you wrote:
The sequence of call, test, jne (or slight variations) occurs in
1000's of places, if a better alternative can be found there could be
significant perofrmance gains.
If the time taken to do the test and branch is really significant compared
to the time taken by the called function, the called function probably has
the grong interface; the loop should be in the callee.
I.e. like using fgetc when you should be using fread.
Now, and interesting compiler project would be to do this re-factoring
automatically in the compiler... standard inlining will do that, but with
a lot of code expansion. It might be more useful to find loops that are similar
and place them out-of-line as a new function, and have that inline the original
callee. Maybe something for the next Summer Of Code...