[LLVMdev] CPS

Mark Leone markleone at gmail.com
Sat Feb 5 22:37:01 PST 2011


CPS conversion doesn't necessarily get rid of function-calling
overhead.  A tail call is indeed a jump, but constructing the closure
of the continuation is usually more expensive than constructing a
stack frame.

Having said that, it's an interesting topic.  For example, CPS
conversion makes the implementation of call/cc trivial, which might
make LLVM a more attractive target for implementing functional
languages, cooperative software threading, etc.  I'm sure lots of
folks would be interested in hearing more about your work.

Mark Leone


On Sat, Feb 5, 2011 at 4:57 AM, Carlo Alberto Ferraris
<cafxx at strayorange.com> wrote:
> Hi everybody,
> I'd like to try implementing a pass that transforms all functions (and
> function calls, returns, etc.) to CPS, so that TCO can get rid of all
> (or most of) the function calling overhead (because, as you probably
> know, the side effect of using CPS is that all function calls become
> tail calls).
> That being said, and since I'm pretty new to LLVM, I'd like to ask a
> couple of things to the veterans:
> 1. Can you see anything really wrong with the general idea of having
> such a transformation?
> 2. Has anybody worked on something like this in the past? Are there any
> starting points you'd suggest I should take a look at?
> 3. Do you have any advice about which direction should I take?
>
> B.R.,
> Carlo Alberto Ferraris
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list