Hi Jonathan,
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.
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.
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
If this is meant for beginners, I would say that a brief description or a link to these new concepts would be helpful.
Thanks,
Shang-Yi
2013/12/6 Mikael Lyngvig <
mik...@lyngvig.org>