[LLVMdev] Porting LLVM backend is no fun yet

Anton Korobeynikov anton at korobeynikov.info
Mon Apr 13 10:44:57 PDT 2009

Hello, Alex

> for generating C++ records. I was hoping for something that would allow me
> to specify my target machine (more inline with what GCC does) and then just
> stand back and watch the target code be generated. I guess a deeper
> understanding of Target classes is mandatory before proceeding to use
> TableGen.
That's true. TableGen can automate many important cases, but surely
not the everything, since targets differs *alot*. Extending TableGen
language to handle all possible cases would yield another language and
it's quite questionable whether it will be better than C++ :)

> I guess what would help would be a tutorial that shows how one goes about
> writing a back-end for a fictitious target machine - something similar to
> "Porting GCC for Dunces"
> (http://ftp.axis.se/pub/users/hp/pgccfd/pgccfd.pdf). Also
> a pre-made "Dummy" back-end that had some basic instructions would also go a
> long way in helping someone write a back-end.
Recently on the horizont appeared some group of enthusiasts willing to
write MSP430 backend. I'm trying to make their learning curve less
steep and thus started such backend by myself. You can monitor the git
repository at http://repo.or.cz/w/llvm/msp430.git. It contains dummy
backend and also has several early steps already done.

There is also some description what's going on
http://community.livejournal.com/ru_llvm/, but unfortunately, only in
russian. Hopefully someday it become a proper "Backend for Dummies"

Hope this will help somehow.
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University

More information about the llvm-dev mailing list