Tuesday, September 25, 2012

Compiler Intermediate Representations

Recently I have been studying up on various intermediate representations for compilers. Heads and shoulders above the rest in popularity is of course LLVM. Interestingly, the more I read about and work with LLVM, the more I see the parallels with the FLINT intermediate representation used in Standard ML of New Jersey (SML/NJ). One of LLVM's key features is the so-called language-independent type system. This type system enables overloading of LLVM instruction opcodes to keep the instruction set small. The type system is also supposed to help debug optimizers. At least in terms of this application, FLINT's typed intermediate representation was also intended to help debug optimizer phases.

Apart from garbage collection, the other common facility intermediate representations and virtual machines must support is exception handling. LLVM supports exception handling and other forms of non-standard control flow through something evocative of delimited continuations in the form of two instructions invoke and unwind.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.