Writing an LLVM Compiler Backend

Hi Rudskyy,

The place to ask LLVM-related questions is llvmdev@cs.uiuc.edu – I’ve cc’d the list.

2009/1/30 Rudskyy <tema13tema@yahoo.de>

I need some help in subject: “Writing an LLVM Compiler Backend”!

There is a processor with a simple assembly code (http://hilscher.com/ xPEC- processor). I understand, that I need to convert a llvm-IR code to my specific assembly (no JIT).

But I haven’t experience in compilers. I have found llvm-projects and try to implement it to my task, but don’t success!

Can you help, suggest to start from?

Judging by your email, I assume you were looking at http://llvm.org/docs/WritingAnLLVMBackend.html ? If you’re not familiar with compilers or LLVM, consider reading some documents and looking at some of the presentations here: http://llvm.org/docs/#llvmdesign .

You can also see how other backends are implemented in LLVM: http://llvm.org/svn/llvm-project/llvm/trunk/lib/Target/ . You’ll want to read about Tablegen: http://llvm.org/docs/TableGenFundamentals.html which will tell you how to write the .td files to describe your target, and then write the correct components (code generator, assembly printer, etc.) for your target.

Good luck!

Misha