Inlining functions with loops

"Michael Rice" <mpr@absoft.com>
Wed, 29 Nov 1995 18:01:25 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: compilers@iecc.com robison@kai.com (Arch Robison) (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)
[9 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: "Michael Rice" <mpr@absoft.com>
Keywords: optimize, C++, question
Organization: Compilers Central
Date: Wed, 29 Nov 1995 18:01:25 GMT

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?


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.


For example: if(c1) e1 else e2 can be converted to c1 ? e1 : e2
                            e1; e2; e3 can be converted to e1,e2,e3


What other languages allow inlining functions, and what constructs
make the function un-inlinable in these languages?


I suppose some pseudo-expression for loops could be created to handle
this.


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


--
Mike Rice (mpr@absoft.com)
Absoft Corporation
--


Post a followup to this message

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