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: 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...



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