Have a personal or library account? Click to login
LLVM Cookbook Cover

LLVM Cookbook

Over 80 engaging recipes that will help you build a compiler frontend, optimizer, and code generator using LLVM

Paid access
|Sep 2025
Product purchase options

Key Features

    Book Description

    The book is for compiler programmers who are familiar with concepts of compilers and want to indulge in understanding, exploring, and using LLVM infrastructure in a meaningful way in their work.
    This book is also for programmers who are not directly involved in compiler projects but are often involved in development phases where they write thousands of lines of code. With knowledge of how compilers work, they will be able to code in an optimal way and improve performance with clean code.

    What you will learn

    • Introduction to LLVM modular design and LLVM tools Write a frontend for a language Add JIT support and use frontends for different languages Learn about the LLVM Pass infrastructure and the LLVM Pass Manager Create analyses and transform optimization passes Build a LLVM TOY backend from scratch Optimize the code at SelectionDAG level and allocate registers to variables

    Who this book is for

    Table of Contents

    1. Getting started with llvm
    2. Steps in Writing a Frontend
    3. Adding JIT Support and Writing Front-Ends for languages
    4. Preparing Optimization
    5. Implementing optimization
    6. Target Independent Code Generator
    7. Optimizing generated code and Register Allocation
    8. Writing an LLVM Backend
    9. Using LLVM for various useful projects
    PDF ISBN: 978-1-78528-640-7
    Publisher: Packt Publishing Limited
    Copyright owner: © 2015 Packt Publishing Limited
    Publication date: 2025
    Language: English
    Pages: 296