[PATCH] nreverse

Devang Patel dpatel@apple.com
Tue Apr 15 19:29:00 GMT 2003


On Tuesday, April 15, 2003, at 10:58 AM, Mark Mitchell wrote:

> And if we're going to start factoring NULL tests out of functions to
> avoid function call overhead, the the right way to do that is:
>
>   bool predicate_f (tree);
>
>   #define predicate(T) ((T) ? predicate_f ((T)) : false)
>
> or the equivalent version with an inline function.
>

hmm... this reminded this quick hack I have in my local sources since 
last
couple of months. This reduces nreverse () call from 14129 to 4405 calls
for hello world in C++ using std::cout. It reduces nreverse () calls 
from
32090 to 11370 on larger test case.

OK to commit ?
Thank you,
-Devang

  2003-04-15  Devang Patel <dpatel@apple.com>

        * tree.h (nreverse_fn): Rename nreverse () as nreverse_fn ().
        (nreverse): #define to call nreverse_fn ().
        * tree.c (nreverse_fn): Rename nreverse () as nreverse_fn ().

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nreverse.diff
Type: application/octet-stream
Size: 2893 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030415/66721c78/attachment.obj>


More information about the Gcc-patches mailing list