Re: Inlining functions with loops

ayers@apollo.hp.com (Andrew Ayers)
Thu, 30 Nov 1995 18:59:32 GMT

          From comp.compilers

Related articles
Inlining functions with loops mpr@absoft.com (Michael Rice) (1995-11-29)
Re: Inlining functions with loops jplevyak@violet-femmes.cs.uiuc.edu (1995-11-30)
Re: Inlining functions with loops meissner@cygnus.com (Michael Meissner) (1995-11-30)
Re: Inlining functions with loops preston@tera.com (1995-11-30)
Re: Inlining functions with loops ayers@apollo.hp.com (1995-11-30)
Re: Inlining functions with loops cdg@nullstone.com (1995-12-01)
Re: Inlining functions with loops jeremy@suede.sw.oz.au (1995-12-01)
Inlining functions with loops dave@occl-cam.demon.co.uk (Dave Lloyd) (1995-12-01)
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)
[4 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: ayers@apollo.hp.com (Andrew Ayers)
Keywords: optimize, C++
Organization: HP/Apollo Massachusetts Language Lab
References: 95-11-241
Date: Thu, 30 Nov 1995 18:59:32 GMT

"Michael Rice" <mpr@absoft.com> writes:


    > All C++ compilers that I am aware of will not inline a function if it
    > contains any type of loop. Is anyone aware of ANY C++ compiler that
    > will do this? Is anyone aware of a compiler for any language which is
    > able to do this?


HP's compilers can inline almost anything, save perhaps certain types
of vararg calls. They can also do cross-language inlines (eg inline
FORTRAN into C++, or vice-versa). This inlining is done by the
optimizer, not by the frontend.


    > I believe the basic problem is the inability to convert such a function
    > to a suitable expression tree. That is, loops are syntactically statements
    > with no equivalent expression-like construct.


This is only an issue if you do your inlining when the code is
expresed as syntax trees.


    > I also have to wonder if this is worth the work. Any comments?


There are certainly substantial performance gains to be had by
choosing the right set of functions to inline. Whether either the
programmer or the compiler is capable of identifying this set is
another problem altogether.


                -- Andy Ayers
--


Post a followup to this message

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