This is the mail archive of the gcc-patches@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]

[PATCH] nreverse



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 at apple dot 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 ().

Attachment: nreverse.diff
Description: Binary data


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