BOOKS - Learn LLVM 17: A beginner's guide to learning LLVM compiler tools and core li...
US $8.72
309569
309569
Learn LLVM 17: A beginner's guide to learning LLVM compiler tools and core libraries with C++
Author: Kai Nacke
Year: January 12, 2024
Format: PDF
File size: PDF 3.4 MB
Language: English
Year: January 12, 2024
Format: PDF
File size: PDF 3.4 MB
Language: English
Learn how to build and use all parts of real-world compilers, including the frontend, optimization pipeline, and a new backend by leveraging the power of LLVM core librariesKey FeaturesGet to grips with effectively using LLVM libraries step-by-stepUnderstand LLVM compiler high-level design and apply the same principles to your own compilerAdd a new backend to target an unsupported CPU architectureBook DescriptionLLVM was built to bridge the gap between compiler textbooks and actual compiler development. It provides a modular codebase and advanced tools which help developers to build compilers easily. This book provides a practical introduction to LLVM, gradually helping you navigate through complex scenarios with ease when it comes to building and working with compilers.You'll start by configuring, building, and installing LLVM libraries, tools, and external projects. Next, the book will introduce you to LLVM's design, unraveling its practical applications in each compiler frontend, optimizer, and backend. Using a real programming language subset, you'll build a frontend, generate LLVM IR, optimize it through the pipeline, and generate machine code from it. Advanced chapters cover how to extend LLVM with a new pass, and how to use LLVM tools to debug and raise the quality of your code. You'll also focus on Just-in-Time compilation issues and the current state of JIT-compilation support that LLVM provides, before finally going on to understand how to develop a new backend for LLVM, which introduces you to the target description and how instruction selection works.By the end of this book, you'll have practical, hands-on experience with the LLVM compiler development framework through real-world examples and source code snippets.What you will learnConfigure, compile, and install the LLVM frameworkUnderstand how the LLVM source is organizedDiscover what you need to do to use LLVM in your own projectsExplore how a compiler is structured, and implement a tiny compilerGenerate LLVM IR for common source language constructsSet up an optimization pipeline and tailor it for your own needsExtend LLVM with transformation passes and clang toolingAdd new machine instructions and a complete backendWho this book is forThis book is for compiler developers, enthusiasts, and engineers who are new to LLVM and are interested in learning about the LLVM framework. It is also useful for C++ software engineers looking to use compiler-based tools for code analysis and improvement, as well as casual users of LLVM libraries who want to gain more knowledge of LLVM essentials. Intermediate-level experience with C++ programming is mandatory to understand the concepts covered in this book more effectively.Table of ContentsInstalling LLVMThe structure of a compilerTurning the source file into an abstract syntax treeBasics of IR Code GenerationIR generation for high-level language constructsAdvanced IR generationOptimizing IRThe TableGen languageJIT compilationDebugging using LLVM toolsThe target descriptionInstruction SelectionBeyond Instruction Selection