<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Jack,<div class=""><br class=""></div><div class="">There’s a rough learning path to LLVM, both because its intrinsic complexity and the lack of deep documentation, so I don’t think that a completely new backend can be produced in a short time. I think that only who have already previous experience with LLVM could do it. To complicate things, it looks that the few available documents are scattered down in Google searches, so they are not easy to find either. The fact that google seems to give different results depending on your computer settings (starting by language) and your past searching history does not help to have a consistent experience for all of us.</div><div class=""> </div><div class="">I joined LLVM only 3 months ago, so by no way I am an expert but I managed to successfully implement a custom LLVM backend as part of a project I am working on. This is a list of links that I collected over that time that I found useful: </div><div class=""><br class=""></div><div class=""><a href="https://jonathan2251.github.io/lbd/index.html" class="">https://jonathan2251.github.io/lbd/index.html</a>  </div><div class=""><br class=""></div><div class=""><a href="https://pdfs.semanticscholar.org/2298/9c214aedc3c58af857d6edc29770c544848c.pdf" class="">https://pdfs.semanticscholar.org/2298/9c214aedc3c58af857d6edc29770c544848c.pdf</a></div><div class=""><br class=""></div><div class=""><a href="https://opus4.kobv.de/opus4-fau/files/1108/tricore_llvm.pdf" class="">https://opus4.kobv.de/opus4-fau/files/1108/tricore_llvm.pdf</a></div><div class=""><br class=""></div><div class="">Unfortunately, most of the above is partially outdated, due to the frenetic stream of changes that LLVM has received over the last few years, but the good point is that these documents cover some deep aspects that are hardly available on the official documentation.</div><div class=""><br class=""></div><div class="">I shall also mention that I started by purchasing the  "Getting Started with LLVM Core Libraries” and “LLVM Essentials” books, but to be honest I wouldn’t recommend them as I found them to be the least useful resources of all. The problem is that the authors attempt to cover so much and they ultimately fail to cover anything properly.</div><div class=""><br class=""></div><div class=""><div class="">The usual approach is to start from an already implemented (and working) backend that resembles most the architecture you want to implement. Study a backend by stepping its source code with a debugger, and create another one according to your needs. The documents linked above have helped me to understand essential concepts at times where I got stuck. The positive point of this approach, is that you don’t necessarily need to understand absolutely everything. You learn as you go, and as long as you get the concepts right, you will be able to produce code to your needs and solve all compiler issues specific to your backend (although not in no time, I’m afraid)</div></div><div class=""><br class=""></div><div class="">Of course, the LLVM mailing lists are also a source of information and the place to ask concrete questions. You won’t immediately find all the answers, but in most cases developers will reply with something that will be useful to you in order to continue your journey.</div><div class=""><br class=""></div><div class="">So, good luck with your project!</div><div class=""><br class=""></div><div class="">Joan.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 25 Jul 2019, at 10:16, 林政宗 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="line-height: 1.7; font-size: 14px; font-family: Arial;" class=""><div class="">hello, there.</div><div class=""><br class=""></div><div class="">I am new and very interested in llvm. I have read the language reference, developer manual, backend guide, tablegen guide, pass guide and other related materials. and I have started to read the source code of llvm-8.0.1.</div><div class="">I want to write a backend to support part of mips instructions or part of sparc instructions. <br class=""></div><div class="">There is few compiler engineerer around me. Could you give me some suggestion? Thanks in advance!<br class=""></div><div class="">If I wanna to make it quickly, are there any tips or tutorials(the backend tutorial on 3.9 is hard to understand)?  Thank you!</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">sincerely<br class=""></div><div class="">Jack<br class=""></div><div class=""><br class=""></div></div><br class=""><br class=""><span title="neteasefooter" class=""><div class=""> <br class="webkit-block-placeholder"></div></span>_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>