[LLVMdev] LLVM for functional languages?

Chris Lattner sabre at nondot.org
Tue Mar 15 07:52:16 PST 2005


On Tue, 15 Mar 2005, Christof Douma wrote:
> I was looking at LLVM as a target for EHC
> (http://catamaran.labs.cs.uu.nl/twiki/st/bin/view/Ehc) which is a
> Haskell compiler. I got some questions on the status of LLVM.

Ok, cool. :)

> I read some discussions on tail calls, and was wondering if they are
> implemented.

Unfortunately, not yet.  This is something that has been on the todo list 
for a long time, but noone has done it yet.

In the short term, you can probably make a lot of progress without needing 
this.  By the time you will really need it, you will probably know enough 
about LLVM to implement it yourself if noone beats you to it.

Here are some notes on the subject:
http://nondot.org/sabre/LLVMNotes/GuaranteedEfficientTailCalls.txt

> Furthermore many comments in lib/Target/.. state:
> '// FIXME: Implement the invoke/unwind instructions!'
> I understood this is an old comment. Is it? If so, It might be good to
> remove them. :)

The LLVM code generators fully support invoke/unwind.

> The model targeted by the code generation is based on GRIN
> (http://www.cs.chalmers.se/~boquist/phd/index.html) which promotes a
> calling convention based on passing arguments in registers as much as
> possible.
>
> Is it possible to return multiple values in registers? I could not find
> anyting on this.

Not yet, but this too is in the plans:
http://nondot.org/sabre/LLVMNotes/MultipleReturnValues.txt

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list