Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries
LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries

LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries: Design powerful and reliable compilers using the latest libraries and tools from LLVM

eBook
€20.99 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore Clang, LLVM’s middle-end and backend, in a pragmatic way
  • Develop your LLVM skillset and get to grips with a variety of common use cases
  • Engage with real-world LLVM development through various coding examples

Description

Every programmer or engineer, at some point in their career, works with compilers to optimize their applications. Compilers convert a high-level programming language into low-level machine-executable code. LLVM provides the infrastructure, reusable libraries, and tools needed for developers to build their own compilers. With LLVM’s extensive set of tooling, you can effectively generate code for different backends as well as optimize them. In this book, you’ll explore the LLVM compiler infrastructure and understand how to use it to solve different problems. You’ll start by looking at the structure and design philosophy of important components of LLVM and gradually move on to using Clang libraries to build tools that help you analyze high-level source code. As you advance, the book will show you how to process LLVM IR – a powerful way to transform and optimize the source program for various purposes. Equipped with this knowledge, you’ll be able to leverage LLVM and Clang to create a wide range of useful programming language tools, including compilers, interpreters, IDEs, and source code analyzers. By the end of this LLVM book, you’ll have developed the skills to create powerful tools using the LLVM framework to overcome different real-world challenges.

Who is this book for?

This book is for software engineers of all experience levels who work with LLVM. If you are an academic researcher, this book will help you learn useful LLVM skills in a short time and enable you to build your prototypes and projects quickly. Programming language enthusiasts will also find this book useful for building a new programming language with the help of LLVM.

What you will learn

  • Find out how LLVM's build system works and how to reduce the building resource
  • Get to grips with running custom testing with LLVM's LIT framework
  • Build different types of plugins and extensions for Clang
  • Customize Clang's toolchain and compiler flags
  • Write LLVM passes for the new PassManager
  • Discover how to inspect and modify LLVM IR
  • Understand how to use LLVM's profile-guided optimizations (PGO) framework
  • Create custom compiler sanitizers

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 22, 2021
Length: 370 pages
Edition : 1st
Language : English
ISBN-13 : 9781838829728
Vendor :
LLVM
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 22, 2021
Length: 370 pages
Edition : 1st
Language : English
ISBN-13 : 9781838829728
Vendor :
LLVM
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 147.97
Software Architecture with C++
€68.99
Learn LLVM 12
€41.99
LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries
€36.99
Total 147.97 Stars icon

Table of Contents

17 Chapters
Section 1: Build System and LLVM-Specific Tooling Chevron down icon Chevron up icon
Chapter 1: Saving Resources When Building LLVM Chevron down icon Chevron up icon
Chapter 2: Exploring LLVM's Build System Features Chevron down icon Chevron up icon
Chapter 3: Testing with LLVM LIT Chevron down icon Chevron up icon
Chapter 4: TableGen Development Chevron down icon Chevron up icon
Section 2: Frontend Development Chevron down icon Chevron up icon
Chapter 5: Exploring Clang's Architecture Chevron down icon Chevron up icon
Chapter 6: Extending the Preprocessor Chevron down icon Chevron up icon
Chapter 7: Handling AST Chevron down icon Chevron up icon
Chapter 8: Working with Compiler Flags and Toolchains Chevron down icon Chevron up icon
Section 3: "Middle-End" Development Chevron down icon Chevron up icon
Chapter 9: Working with PassManager and AnalysisManager Chevron down icon Chevron up icon
Chapter 10: Processing LLVM IR Chevron down icon Chevron up icon
Chapter 11: Gearing Up with Support Utilities Chevron down icon Chevron up icon
Chapter 12: Learning LLVM IR Instrumentation Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(7 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Mitchel Dickerson May 25, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have been working hacking on LLVM full time for my research for just under two years at this point, and I can honestly say that I wish I had such good introduction material when I first started. The most common approach for learning LLVM previously has been to read the documentation and then learn from code already in LLVM that performs tasks similar to the ones you hope to achieve.This book provides what I feel is a much better approach to starting on what can be a very daunting code base. The sections to the book are well thought out and give a good overview of where to approach the compiler depending on what particular problem you are trying to tackle. If you have a project that requires work in C++ front end, the Clang sections are an excellent starting point for getting access to the tools you need to start tackling the problems you actually want to solve.If your project involves some other language that uses LLVM, then the "Middle-end" Development will get you all the tools you need to modify the IR passed on to LLVM (as a note to people starting with languages other than C or C++ that use LLVM, you will likely have to refer to the language's compiler if you want to delve in to "front end" work for that language, Rust being a notable example). Fairly quickly within the section the author presented modules and functionality that helped me to better implement my own work in LLVM.Ultimately, if you are looking to get started in LLVM and need a place to start, this is the best starting point there is. The documentation, source code, and community are important, but this book will get you started quickly and effectively.
Amazon Verified review Amazon
Amazon Customer
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is very easy to follow and provides an introduction to many useful LLVM abstractions. It is very well written, you can see a lot of effort was put into into it, i.e. well edited. Definitely one of the best of the books I've read about compilers.
Amazon Verified review Amazon
Paul Kirth May 28, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a very nice introduction to development with LLVM. Many of the subtle points raised in this book can be difficult to find without extensive knowledge about the codebase. The author provides practical guidance for setting up a variety of projects within the compiler infrastructure and explains in detail the normal way compiler developers organize and modify their projects to achieve a variety of results. In particular he makes some of the more challenging aspects of starting new projects simple and straight forward. In particular, I found his descirption of the runtime components to be straight forward, when most explanations I've seen within the documentation and across various blog posts to be overly complex.LLVM is a big project, an unless you've worked across many of its various components, i.e., frontend development, analysis, instrumentation, code generation, and the runtime components getting started in a new area can be a challenge, even if you've been working on the compiler for a long time. Even though I've worked on LLVM for a long time, I'll probably reach for this as a reference for how to do a few things.While I would have liked more advanced topics to explored a bit more deeply, I look forward to the author's inevitable follow up, which will no doubt be focused on more complex compiler problems and advanced use of LLVM. Overall a must have for new LLVM developers, students, and researchers.
Amazon Verified review Amazon
Amazon Customer Jun 24, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a phenomenal resource for novice programmers aiming to deepen their understanding of compiler design and optimization using the LLVM infrastructure. The content is comprehensive and addresses every aspect of LLVM in a practical, relatable manner.Right from the first chapter, which efficiently explains how to reduce resource consumption when building LLVM from source, to the sections on handling AST and customizing Clang's toolchain, this book presents complex concepts in an easy-to-grasp format. Each chapter is peppered with real-world examples, code snippets, and practical use cases, enabling the reader to instantly apply the acquired knowledge.One of the book's key strengths is the way it demystifies LLVM IR (Intermediate Representation), which is a critical aspect of compiler design. The chapter on "Processing IR in a proper way" delivers insights into how to inspect and modify LLVM IR, providing a valuable foundation for developing tools for transforming and optimizing source programs.Another highlight is the exploration of LLVM's build system and the LLVM LIT framework. The book provides step-by-step guidance on building plugins, extensions, and custom compiler sanitizers. Even advanced topics like profile-guided optimization (PGO) are discussed with clarity and precision.In terms of accessibility, this book does an excellent job of catering to a wide audience. Whether you are a seasoned software engineer, an academic researcher, or a programming language enthusiast, there's something valuable to extract from this book. Furthermore, the information is presented in a logical, sequential manner, building on previous topics and facilitating a smooth learning curve.
Amazon Verified review Amazon
Jay May 21, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you’re looking to extend Clang, this is a wonderful resource.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon