Zum Hauptinhalt springen
Nicht aus der Schweiz? Besuchen Sie lehmanns.de
LLVM Code Generation - Quentin Colombet

LLVM Code Generation

A deep dive into compiler backend development
Buch | Softcover
620 Seiten
2025
Packt Publishing Limited (Verlag)
978-1-83763-778-2 (ISBN)
CHF 66,30 inkl. MwSt
Explore the world of code generation with the LLVM infrastructure, and learn how to extend existing backends or develop your own

Get With Your Book: PDF Copy, AI Assistant, and Next-Gen Reader Free

Key Features

Understand the steps involved in generating assembly code from LLVM IR
Learn the key constructs needed to leverage LLVM for your hardware or backend
Strengthen your understanding with targeted exercises and practical examples in every chapter

Book DescriptionThe LLVM infrastructure is a popular compiler ecosystem widely used in the tech industry and academia. This technology is crucial for both experienced and aspiring compiler developers looking to make an impact in the field. Written by Quentin Colombet, a veteran LLVM contributor and architect of the GlobalISel framework, this book provides a primer on the main aspects of LLVM, with an emphasis on its backend infrastructure; that is, everything needed to transform the intermediate representation (IR) produced by frontends like Clang into assembly code and object files.
You’ll learn how to write an optimizing code generator for a toy backend in LLVM. The chapters will guide you step by step through building this backend while exploring key concepts, such as the ABI, cost model, and register allocation. You’ll also find out how to express these concepts using LLVM's existing infrastructure and how established backends address these challenges. Furthermore, the book features code snippets that demonstrate the actual APIs.
By the end of this book, you’ll have gained a deeper understanding of LLVM. The concepts presented are expected to remain stable across different LLVM versions, making this book a reliable quick reference guide for understanding LLVM.What you will learn

Understand essential compiler concepts, such as SSA, dominance, and ABI
Build and extend LLVM backends for creating custom compiler features
Optimize code by manipulating LLVM's Intermediate Representation
Contribute effectively to LLVM open-source projects and development
Develop debugging skills for LLVM optimizations and passes
Grasp how encoding and (dis)assembling work in the context of compilers
Utilize LLVM's TableGen DSL for creating custom compiler models

Who this book is forThis book is for both beginners to LLVM and experienced LLVM developers. If you’re new to LLVM, it offers a clear, approachable guide to compiler backends, starting with foundational concepts. For seasoned LLVM developers, it dives into less-documented areas such as TableGen, MachineIR, and MC, enabling you to solve complex problems and expand your expertise. Whether you’re starting out or looking to deepen your knowledge, this book has something for you.

Quentin Colombet is a veteran LLVM contributor specializing in compiler backends. He is the architect of the new instruction selection framework (GlobalISel) and code owner of the LLVM register allocators. With over two decades of experience, he has worked on compiler backends for a variety of architectures, including GPU, CPU, microcontrollers, DSP, and ASICs. Quentin joined Apple in 2012 and has contributed to x86, Aarch64, and Apple GPU backends. He is passionate about helping newcomers onboard the LLVM infrastructure, having mentored interns and new hires over the years.

Table of Contents

Building LLVM and Understanding the Directory Structure
Contributing to LLVM
Compiler Basics and How They Map to LLVM APIs
Writing Your First Optimization
Dealing with Pass Managers
TableGen – LLVM Swiss Army Knife for Modeling
Understanding LLVM IR
Survey of the Existing Passes
Introducing Target-Specific Constructs
Hands-On Debugging LLVM IR Passes
Legacy Instruction Selection Framework - SelectionDAG
Getting Started with the Machine Code Layer
The Machine Pass Pipeline
Getting Started with Instruction Selection
Instruction Selection: The IR Building Phase
Instruction Selection: The Legalization Phase
Instruction Selection: The Selection Phase and Beyond
Instruction Scheduling
Register Allocation
Lowering of the Stack Layout
Getting Started with the Assembler

Erscheinungsdatum
Vorwort Kristof Beyls
Verlagsort Birmingham
Sprache englisch
Maße 191 x 235 mm
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Informatik Theorie / Studium Compilerbau
ISBN-10 1-83763-778-4 / 1837637784
ISBN-13 978-1-83763-778-2 / 9781837637782
Zustand Neuware
Informationen gemäß Produktsicherheitsverordnung (GPSR)
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich
Grundlagen und Anwendungen

von Hanspeter Mössenböck

Buch | Softcover (2024)
dpunkt (Verlag)
CHF 41,85
a beginner's guide to learning llvm compiler tools and core …

von Kai Nacke

Buch | Softcover (2024)
Packt Publishing Limited (Verlag)
CHF 66,30