Re: how to generate code for (a,b):=(b,a)

William D Clinger <will@ccs.neu.edu>
17 May 1997 00:07:21 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: how to generate code for (a,b):=(b,a) cliffc@risc.sps.mot.com (Cliff Click) (1997-05-12)
Re: how to generate code for (a,b):=(b,a) wilson@cs.utexas.edu (1997-05-12)
Re: how to generate code for (a,b):=(b,a) tim@wfn-shop.Princeton.EDU (1997-05-13)
Re: how to generate code for (a,b):=(b,a) cdg@nullstone.com (Christopher Glaeser) (1997-05-13)
Re: how to generate code for (a,b):=(b,a) genew@vip.net (1997-05-13)
Re: how to generate code for (a,b):=(b,a) bobduff@world.std.com (1997-05-13)
Re: how to generate code for (a,b):=(b,a) will@ccs.neu.edu (William D Clinger) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) wilson@cs.utexas.edu (1997-05-17)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22)
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-25)
[4 later articles]
| List of all articles for this month |

From: William D Clinger <will@ccs.neu.edu>
Newsgroups: comp.compilers
Date: 17 May 1997 00:07:21 -0400
Organization: Northeastern University
References: 97-05-058 97-05-120 97-05-143
Keywords: code, optimize

The parallel assignment problem generalizes to allow arbitrary
expressions on the right-hand side. This generalization is especially
useful if the language does not specify the order of evaluation of
arguments. Even if the language insists upon (e.g.) right-to-left
evaluation, the compiler can still choose the order of evaluation for
contiguous subsequences of argument expressions that have no side
effects.


This optimization interacts nicely with lambda lifting and
interprocedural register targeting [2].


The Orbit compiler for Scheme [1] used this optimization circa 1985,
but the description in [3] is much clearer. In Larceny this
optimization reduces the code size of the standard Scheme library by
about 6%.


Will


[1] David Kranz, Richard Kelsey, Jonathan Rees, Paul Hudak,
          James Philbin, and Norman Adams. ORBIT: an optimizing
          compiler for Scheme. In Proceedings of the SIGPLAN '86
          Symposium on Compiler Construction, ACM SIGPLAN Notices
          21(7), July 1986, pages 219-233.


[2] William Clinger and Lars Hansen. Lambda, the ultimate label;
          or a simple optimizing compiler for Scheme. In Proceedings
          of the 1994 ACM Conference on Lisp and Functional Programming,
          June 1994, pages 128-139. See also
          http://www.ccs.neu.edu/home/will/Twobit/index.html and
          http://www.ccs.neu.edu/home/will/Twobit/p4pao.html


[3] Robert G Burger, Oscar Waddell, and R. Kent Dybvig.
          Register allocation using lazy saves, eager restores,
          and greedy shuffling. In 1995 ACM Conference on Programming
          Language Design and Implementation, June 1995, pages 130-138.
          Available online via
ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/Reg-Alloc-PLDI95.ps.gz
--


Post a followup to this message

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