Message from discussion CPS and optimization
From: D Herring <dherr...@at.tentpost.dot.com>
Subject: Re: CPS and optimization
Date: Wed, 10 Nov 2010 01:34:01 -0500
Organization: A noiseless patient Spider
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Injection-Date: Wed, 10 Nov 2010 06:34:02 +0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="ydozjAGyeA7MLfD76BLrUw";
logging-data="16788"; mail-complaints-to="ab...@eternal-september.org"; posting-account="U2FsdGVkX19XY3pNRUKNXmVvgur0P3tO"
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:220.127.116.11) Gecko/20100916 Thunderbird/3.1.4
On 11/09/2010 10:53 PM, Peter Keller wrote:
> I know of the correspondance between CPS and SSA forms, is that what I
> would apply here? I'd convert the CPS form to SSA basic blocks, perform
> the optimization operations upon it, then convert it back to CPS?
Rather each SSA optimization should have an equivalent optimization
for "well behaved" CPS forms. The well-behaved restriction comes from
CPS allowing some things that are not possible in SSA.
[OT] If you do convert to SSA, I'd just throw the code through LLVM.
It seems to me that low-level optimizations (e.g. local scheduling,
opcode selection, and register allocation) are fairly well solved
whereas higher-level optimizations (e.g. profiling-driven inlining,
fast-path generation, and data-structure selection) need more
interaction with the programmer and provide interesting new opportunities.