[LLVMdev] Criticism of garbage collection support in LLVM

Jon Harrop jon at ffconsultancy.com
Sat Jan 17 12:24:46 PST 2009


On Saturday 17 January 2009 18:18:50 Mikhail Glushenkov wrote:
> This may be of interest:
>
> http://lhc-compiler.blogspot.com/2009/01/case-against-cllvm.html
>
> People implementing a new Haskell compiler explain why LLVM is an
> unsuitable target for them.

FWIW, I am a physicist with no formal training in compiler writing yet LLVM 
has allowed me to create a compiler for a statically-typed functional 
language in only one week that outperforms OCaml on a variety of numerical 
benchmarks, often by a substantial margin on x86.

Moreover, I took the simplest design choice at every stage in order to 
maximize the chances of actually ending up with a working compiler. In 
particular, I used a shadow stack based on the pessimistic assumption that 
LLVM is uncooperative and I found the performance degradation to be 
insignificant on all code except integer Fibonacci which is ~30% slower but 
only because I have not yet optimized away the shadow stack for functions 
that do not use reference types.

So if anyone is considering writing a compiler for a functional language, I 
strongly recommend building upon LLVM.

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e



More information about the llvm-dev mailing list