[LLVMdev] Explicitly Managed Stack Frames

Ben Chambers gtg983q at mail.gatech.edu
Wed Jan 11 12:34:33 PST 2006

I was wondering what the current state of this (explicitly managed stack frames)
is.  Is it being worked on?  If not, how hard do you think it would be for me to
add it?  I am more than willing to work on it, but don't have any experience
with LLVM, so it might take a while.  The reason I ask is because I am starting
work on a project to make a language similar to ML with which to experiment, and
hope to build it upon LLVM.  Unfortunately, in order to implement things like
lexical scoping and closures, I need to be able to not only access variables on
the frame but also pass in a static link.

As far as I can tell from reading the notes on the topic, the static link could
be resolved by simply passing a pointer to the appropriate stack frame, so this
isn't a serious issue.

Also, if the continuation passing scheme were to be employed, how many new
optimizations would have to be written to make it actually efficient?  Is the
only necessary change transforming the code to use CPS, or would other passes
have to be written to make it efficient?  How badly would CPS break the other
optimizations that LLVM performs?

Are there ane resources on CPS that provide more insight?  Most of what I could
find online only talked about it from a theoretical perspective and did a lot of
hand waving on the actual specifics.

Thank you for your time,
Ben Chambers

P.S. The document I was referring to for the notes on how to implement this in
LLVM is available at this location:

More information about the llvm-dev mailing list