Related articles |
---|
Inlining functions with loops mpr@absoft.com (Michael Rice) (1995-11-29) |
Re: compilers@iecc.com robison@kai.com (Arch Robison) (1995-11-30) |
Newsgroups: | comp.compilers |
From: | Arch Robison <robison@kai.com> |
Keywords: | optimize, C++ |
Organization: | Compilers Central |
References: | 95-11-241 |
Date: | Thu, 30 Nov 1995 21:34:21 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?
>
> 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 statement presumes that inlining is done at a near-source level
with C-like expressions, as in Cfront. Many non-Cfront compilers
allow inlining of loops. KAI's Photon C++ compiler
(http://www.kai.com/photon/photon_what_is.html) readily inlines loops.
> I also have to wonder if this is worth the work. Any comments?
That depends upon how many customers (that care about performance)
write inline functions with loops, and how well the rest of the
compiler optimizes loops. Now that compilers inline loops, creative
C++ programmers will no doubt find uses for inline loops.
Arch D. Robison Kuck & Associates Inc.
robison@kai.com 1906 Fox Drive
217-356-2288 Champaign IL 61820
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.