Re: Inlining functions with loops

cdg@nullstone.com (Christopher Glaeser)
17 Dec 1995 00:19:02 -0500

          From comp.compilers

Related articles
[8 earlier articles]
Re: Inlining functions with loops serrano@ardeche.IRO.UMontreal.CA (1995-12-01)
Re: Inlining functions with loops tore@lis.pitt.edu (1995-12-09)
Re: Inlining functions with loops preston@tera.com (1995-12-09)
Re: Inlining functions with loops ball@Eng.Sun.COM (1995-12-09)
Re: Inlining functions with loops ok@cs.rmit.edu.au (1995-12-09)
Re: Inlining functions with loops jsa@organon.com (1995-12-09)
Re: Inlining functions with loops cdg@nullstone.com (1995-12-17)
| List of all articles for this month |

From: cdg@nullstone.com (Christopher Glaeser)
Newsgroups: comp.compilers
Date: 17 Dec 1995 00:19:02 -0500
Organization: Compilers Central
References: 95-11-241 95-12-012 95-12-027
Keywords: optimize

John Levine writes:
> [It's pretty common to optimize out tail recursion, but I'd be quite surprised
> if anyone tried to optimize a bushy recursion like this one. -John]


Some compilers will inline small recursive functions to eight or ten levels.
For example, the function move_tower() in the hanoi benchmark looks like:


move_tower();
move_disk();
move_tower();


Compilers that perform both tail recursion and "bushy" inlining get about
10% better performance than compilers that only perform tail recursion, and
get significantly better performance than compilers that don't perform either.


Of course, the increase in code size for that region is significant, and is
not practical in some situations.


Regards,
Christopher Glaeser
Nullstone Corporation
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.