Re: Inlining functions with loops

preston@tera.com (Preston Briggs)
Thu, 30 Nov 1995 23:55:17 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)
[5 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: preston@tera.com (Preston Briggs)
Keywords: optimize, C++, question
Organization: /etc/organization
References: 95-11-241
Date: Thu, 30 Nov 1995 23:55:17 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?


Sure, our compilers will. In fortran, C, or C++.
I'm certain there must be other, more readily available examples.


>I believe the basic problem is the inability to convert such a function
>to a suitable expression tree.


Assuming you have a tree-like IR (not required), you could put the
function body in front of the expression (just like any other loop),
and put the "returned" value in a temporary. Then reference the
temporary in the expression tree.


Preston Briggs
--


Post a followup to this message

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