Summary

In this chapter, we presented a general overview of how the LLVM backend works. We saw the different code generator stages and internal instruction representations that change during compilation. We discussed instruction selection, scheduling, register allocation, code emission, and presenting ways for the reader to experiment with these stages by using the LLVM tools. At the end of this chapter, you should be able to read the llc -debug output, which prints a detailed log of the backend activities, and have a good idea about everything that is happening inside the backend. If you are interested in building your own backend, your next step is to refer to the official tutorial at http://llvm.org/docs/WritingAnLLVMBackend.html. If you are ...

Get Getting Started with LLVM Core Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.