[comp.compilers] Un-inlining?

jallen@libserv1.ic.sunysb.edu (Joseph Allen) (05/08/91)

Do any optimizers un-inline (outline)?  With the way some register allocation
optimizers work this would surely be beneficial.

--
/*  jallen@ic.sunysb.edu  */ /* Joe Allen 129.49.12.74 */
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

pardo@june.cs.washington.edu (David Keppel) (05/09/91)

Joseph Allen <jallen@libserv1.ic.sunysb.edu> writes:
>Do any optimizers un-inline (outline)?

Yes, it's called `proceduralization'.

The idea is to take common idioms and stuff them in to a single
function.

See the Irvine Program Transformation Catalogue and

%A Christopher W. Fraser
%A Eugene W. Myers
%A Alan L. Wendt
%T Analyzing and Compressing Assembly Code
%B Proceedings of the ACM SIGPLAN '84 Symposium on Compiler
Construction
%J SIGPLAN Notices
%V 19
%N 6
%D June 1984
%P 117-121


A related operation is to optimize the common path through a function.
Possible optimizations include delaying register spill/restore until the
values are actually used (rather than ``well they're used *somewhere* in
the function; consider the SPARC `save' and `restore' instructions) and
stack adjusts for storage that is declared at the outermost level but is
used only at some inner level(s).

I know of no compilers that do the latter.

	;-D on  ( In Unlining? )  Pardo
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

preston@titan.rice.edu (Preston Briggs) (05/09/91)

pardo@june.cs.washington.edu (David Keppel) writes:

>A related operation is to optimize the common path through a function.
>Possible optimizations include delaying register spill/restore until the
>values are actually used (rather than ``well they're used *somewhere* in
>the function;

Chow calls this "shrink wrapping" in his Sigplan 88 paper.

	Minimizing Register Usage Penalty at Procedure Calls
	Fred Chow
	Sigplan 88 Conference on Programming Language Design and Implementation

It's apparently implemented in the MIPS compilers.
I've also seen it proposed for the Chez Scheme compiler.

Preston Briggs
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.