[LLVMdev] llvm interpreter for embedded system

Chris Lattner sabre at nondot.org
Wed Sep 14 10:12:41 PDT 2005

On Wed, 14 Sep 2005, Chris Morgan wrote:

> Has anyone looked at porting the llvm interpreter to an embedded
> system?  I've been looking into how to portably run bytecode on a
> lightweight embedded processor and it seemed like interpreting llvm
> bytecode might be a solution.  We would have to write the interpreter
> in c and it would have to fit in a few k of ram and a dozen or less k
> of code space, but I figured I'd ask to see if people think it might
> be possible.

I'm not aware of anyone working on this.  There are several companies 
using LLVM as a static compiler for their embedded chips, but I'm not 
aware of anyone using the interpreter in this way.  You would probably 
want to write a from-scratch interpreter: the currently LLVM interpreter 
is very heavy weight and slow (it was built rapidly to get it working 
fast, not as something that would be a good interpreter).

Another option is that you could write a simple backend for a pseudo 
target that is really easily interpretable.  This would let you JIT 
compile LLVM to this pseudo target, then interpret the result.  This would 
be appealing if you find LLVM too hard to interpret (I don't know why this 
would be the case, but just pointing out the option).



More information about the llvm-dev mailing list