[LLVMdev] Status of Elsa->LLVM
rich at pennware.com
Sat Dec 22 02:40:09 PST 2007
Chris Lattner wrote:
> On Dec 21, 2007, at 1:08 PM, Richard Pennington wrote:
>> I'm a little further along now. I've started to put together a simple
>> driver for Elsa and LLVM that I'm calling "ellsif" (cute name, I think
>> it works).
>> The file being compiled is a "printf" function. Here are timing
>> for optimized and unoptimized runs:
> Cool, this is very nice!
>> Sorry to add noise to the list with this. I'm just very excited. ;-)
>> Again, my compliments to both the Elsa and LLVM teams. It says a lot
>> that I got this far in 19 days of part-time work.
> This is a very cool hack, but I'm curious: what is your goal with this
> work? Are you just trying to see if it can be done, or does elsa
> provide an advantage over using the g++ parser with llvm?
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
Well, primarily I'm doing it for fun.
My background is in compiler design and embedded systems programming, so
I'm interested in both the front end and back end aspects.
I've build gcc many times over the years for different target processors
and was never able to get my head around it internally. It is incredibly
complex. I also didn't like the fact that I had to have N copies of gcc
to support N processors.
I became interested in Elsa (via google) because I liked its extensible
nature. I can drop in new syntax rules easily. It was also fairly easy
At first I looked into SUIF and started down that path. I wasn't
entirely pleased with the results. Then I realized SUIF had been dead
for about 5 years so I started looking around for alternatives and
stumbled on LLVM.
It was easy to lower the Elsa AST to LLVM by using Elsa's extension
I'm now at the point where I can see that compiling C with Elsa is a
done deal. I have about 90% (or more) of basic C covered.
I decided that I wanted a cleaner way to move forward so I started
writing the ellsif driver to automate the steps and make Elsa->LLVM look
like a real tool.
Does Elsa provide an advantage over g++? For me, understanding it is a
big plus. ;-) In addition, Elsa has a Berkeley-like license which I prefer.
I'll let you know if Elsa is a good choice after I get a little further
along adding the C++ support.
Since I only have a few weeks invested in this project, I won't feel too
bad if Elsa turns out to be a dead end. Along the way I found LLVM,
which is definitely the way to go.
I'd like to get the Elsa stuff behind me because I'm itching to do an
LLVM code generator for the Altera Nios2. ;-) I started by copying the
MIPS sources and am studying them to get a feel for what's required.
More information about the llvm-dev