Tags
Language
Tags
April 2024
Su Mo Tu We Th Fr Sa
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 1 2 3 4

LLVM Cookbook

Posted By: AlenMiler
LLVM Cookbook

LLVM Cookbook by Mayur Pandey
English | 30 May 2015 | ISBN: 178528598X | 296 Pages | EPUB/MOBI/PDF (True) | 11.94 MB

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.

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

About This Book

Write a frontend for any language to generate LLVM IR
Create optimization passes to optimize the IR code using LLVM Pass Infrastructure and Pass Manager
Design and implement structures for highly-optimized compilers using LLVM, through detailed step-by-step recipes
Who This Book Is For

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
In Detail

LLVM is a compiler framework with libraries that provides a modern source-and target-independent optimizer, along with a code generator.

This book not only explains the effective use of the compiler infrastructure that LLVM provides, but also helps you implement it in one of your projects. You start with a simple task to get you up-and-running with LLVM, followed by learning the process of writing a frontend for a language, which includes writing a lexer, a parser, and generating IR code. You will then see how to implement optimizations at different levels, generate target-independent code, and then map this generated code to a backend. Finally, you will look into the functionalities that the LLVM infrastructure provides, such as exception handling, LLVM Utility Passes, using sanitizers, the garbage collector, and how we can use these in our projects.