[Newcompiler] Optimizing compiled methods for performance [was: A day optimizing]

bryce at kampjes.demon.co.uk bryce at kampjes.demon.co.uk
Wed May 30 22:08:08 UTC 2007


Klaus D. Witzel writes:
 > Roel stepped in and said that's about the simplest thing any optimizing  
 > compilers can do. He mentioned building a data-glow graph [ed.: MIT's  
 > using that term] on which to do some form of pattern matching. This is a  
 > huge active area of research but Roel hasn't seen something in the context  
 > of blockclosures, for example.

Continuation passing style is a compiler intermediate format that's
used with block closures and first class continuations. The Rabbit
paper by Steele and Sussman, around the time of the "lambda, the ...",
papers from MIT provides a nice description of CPS. It's from the
late 70's and published as an MIT tech report, it's available on
the web.

Appel claims that CPS is equivalent to SSA. He knows his stuff.

Could be worth looking at if you're looking to do high level
optimizations with first class blocks. It originated with Scheme which
can be considered as Smalltalk semantics without a built in dynamic
dispatch but with the tools to build it.

CPS is neat for modeling interprocedural analysis of Smalltalk as
there is only two control flow edges instead of 5 interprocedural
edges in normal Smalltalk. In a Smalltalk CPS there are only closure
calls and message sends. All control flow except sends is done via
closure calls including all kinds of return.

Bryce


More information about the Newcompiler mailing list