Trying to write LLVM. No good tutorial

I am trying to write an LLVM backend for my custom processor that I recently developed.

I tried to follow the official tutorial at http://llvm.org/docs/WritingAnLLVMBackend.html

But it is so vague, so incomplete and blurry, that I could not fulfill it.

Then I started looking for other textbooks online, and they all suffer from the same symptoms of the original textbook. It seems that the authors take a lot of preliminary readings and write their textbooks without the necessary preliminary explanations.

How can I find a tutorial or anything that can set me up to write a functional backend in LLVM?

- Update: I see two voices and two voices. Positive voices say that my question is not related to programming. I wonder how the moderators came to the conclusion that writing a compiler is not related to programming.

+12
source share
1 answer

I came across the same problem and there really are no good tutorials. But I hope that some of them that I found will help you if this is still relevant, or to someone else who has read it.

First of all, there is a general tip: copy and paste the existing backend and change it for your processor. But this is not a good practice, because you do not understand what you are doing. So, I found a book with a brief description of llvm architecture. It can help you a lot. There is also a step- by -step guide on the implementation of the server part for the CPU0 processor. Other sources are erroneous slides that you can easily find on your own.

0
source

All Articles