[LLVMdev] XMOS using LLVM

Richard Osborne richard at xmos.com
Tue Oct 14 12:34:09 PDT 2008


I'm a compiler engineer at XMOS (http://www.xmos.com) and in the last
few months I've been working on porting LLVM to target our XS1-G4 chip.
I thought it may be of interest to the list to find out how we are using
of LLVM.

The XS1-G4 has four processors and 32 hardware threads. It has been
designed to be highly responsive to I/O events allowing many tasks
normally be done by hardware to instead by carried out in software. It
has hardware support for multi-threading, inter thread communication and
efficient I/O operations. More information is available on our website.

The latest release of our software tool chain now contains a C compiler
based on llvm-gcc and LLVM 2.3. Features supported by our backend
include inline assembly, dwarf debug support, 64 bit long long support
and floating point using LLVM's softfloat. The tools can be downloaded
for free after registration with source code for our modified LLVM /
llvm-gcc. At the moment we are using LLVM for C compilation only.
Parallelism and I/O are expressed using a C like language called XC for
which we have a separate bespoke compiler. We are considering adding
support for some of the more novel features of our architecture into
LLVM and maybe merging these two compilers in future.

I have found LLVM a joy to use. It has taken just over 3 months
of work to get to this point from scratch (this also includes porting a
C standard library). LLVM clearly benefits from its modularity - the
code is easy to understand and the interfaces are well designed. We have
also been pleased with the results (efficiency of code produced and
compilation time).

I would like to gauge is how much interest there would be in having our
backend make its way back upstream. If nothing else it would provide a
good example of a fairly complete LLVM backend targeting a nice, simple
RISC instruction set: I know I found the existing backends very helpful
for reference during development. I've read through the developer policy
but wasn't sure how your copyright assignment policy works (would we
need to sign something to contribute?). Where would we go from here?

Richard Osborne | XMOS

More information about the llvm-dev mailing list