Newsgroups: comp.lang.lisp,comp.lang.scheme,comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!delmarva.com!news-out.internetmci.com!internetMCI!newsfeed.internetmci.com!news.mathworks.com!zombie.ncsc.mil!simtel!news3.noc.netcom.net!ix.netcom.com!netcom.com!NewsWatcher!user
From: hbaker@netcom.com (Henry Baker)
Subject: Re: static analysis and CDR coding?
Message-ID: <hbaker-2810952219010001@10.0.2.15>
Sender: hbaker@netcom16.netcom.com
Organization: nil organization
References: <95Oct28.235858edt.179@qobi.ai.toronto.edu>
Date: Sun, 29 Oct 1995 06:19:01 GMT
Lines: 19
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:19769 comp.lang.scheme:14178 comp.lang.dylan:5709

In article <95Oct28.235858edt.179@qobi.ai.toronto.edu>,
Qobi@cs.toronto.edu wrote:

> A thought just occurred to me: can static analysis be used to predict when
> lists are or aren't cdr coded and eliminate the expensive instruction
> sequences to support run-time decisions?

The answer is probably yes.  Appel's group at Princeton did some clever
optimizations in SMLNJ that come very close to cdr-coding.  They could
_automatically_ replace a list of N nodes with a list of N/2 double nodes,
so that no indirections were required to access every other element.  This
optimization is completely transparent, so you can write your program in
a straightforward way, and yet gain the benefits of a very interesting
optimization without hairing up your program with a very error-prone
hand job of optimization.

-- 
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html
