<div dir="ltr">Hi Jonathan,<br><br>After reading/skimming through the official LLVM backend documents, I actually tried following your steps to write a new backend, but how to write td files still remains unclear. The details are not well explained, though I know most of them can be found in other documents or have already been documented somewhere in the LLVM source code or td files.<br>

<br>For a beginner with no experience like me, it is really hard to extract the fundamental structure from existing backends, e.g., what is necessary for an early stage and what is the refined result after years of development. <br>

<br>For example, everything went well with Cpu0RegisterInfo.td, with only a little struggle. But for Cpu0InstrInfo.td, questions start to come up: Why simm16 is inherited from Operand<i32>? What are PatLeaf and ComplexPattern? What is isReMaterializable? etc. Every line of description, every occurrence of new keyword or concept would confuse a beginner reader. They need to find enough information to follow this tutorial. This tutorial seems to tell that you have to write these 10 files, completely, without error, to continue to the next step. And this -- how to start from starch, at least for me, is the most frustrating thing<br>

<br>If this is meant for beginners, I would say that a brief description or a link to these new concepts would be helpful.<br><br>Thanks,<br>Shang-Yi<br><br>2013/12/6 Mikael Lyngvig <<a href="mailto:mikael@lyngvig.org">mikael@lyngvig.org</a>><br>

><br>> I was wondering if this shouldn't somehow find its way into the official LLVM documentation?  It certainly seems to qualify to become official documentation in my eyes.  Nearly any LLVM backend writer out there should be able to benefit from reading about your experiences, I'd think.<br>

><br>> I know it is not as generic and abstract as what the LLVM dev list seems to prefer, but I personally find that the more concrete and based on actual experience a document is, the better the reader's ability to understand what's going on.<br>

><br>> The only thing is that you might not want to go through the process of a peer review.  That will likely add much work to what you have already accomplished.<br>><br>><br>> -- Mikael<br>><br>><br>

><br>><br>> 2013/12/5 Jonathan <<a href="mailto:gamma_chen@yahoo.com.tw">gamma_chen@yahoo.com.tw</a>><br>>><br>>> Hi,<br>>><br>>> I am writing an llvm backend tutorial through my learning process of llvm backend study and implementation. Web as follows,<br>

>><br>>> <a href="http://jonathan2251.github.com/lbd/index.html">http://jonathan2251.github.com/lbd/index.html</a><br>>><br>>> It include 10,000 lines of sources code for<br>>><br>>> 1. Step by step, create an llvm backend for the Cpu0 which beginning from a CPU design for school teaching purpose in system programming.<br>

>> 2. ELF linker for Cpu0 which extended from lld.<br>>> 3. elf2hex extended from llvm-objump.<br>>> 4. Cpu0 verilog source code.<br>>><br>>> With these code, reader can run the generated code from Cpu0 llvm backend compiler, linker and elf2hex and see how it run on your computer.<br>

>> The pdf and epub is also available in the web. It is a tutorial for llvm backend developer but not for an expert.<br>>> It is also can be a material for those who have compiler and Computer Architecture book knowledge and like to know how to extend the llvm<br>

>> toolchain to support a new CPU.<br>>><br>>> Jonathan<br>>><br>>><br>>> _______________________________________________<br>>> LLVM Developers mailing list<br>>> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>

>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>><br>><br>><br>> _______________________________________________<br>> LLVM Developers mailing list<br>

> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>

>
</div>