Jump to ratings and reviews
Rate this book

Getting Started with LLVM Core Libraries by Bruno Cardoso Lopes (15-Aug-2014) Paperback

Rate this book
Get to grips with LLVM essentials and use the core libraries to build advanced tools This book is intended for enthusiasts, computer science students, and compiler engineers interested in learning about the LLVM framework. You need a background in C++ and, although not mandatory, should know at least some compiler theory. Whether you are a newcomer or a compiler expert, this book provides a practical introduction to LLVM and avoids complex scenarios. If you are interested enough and excited about this technology, then this book is definitely for you. LLVM is a bleeding edge compiler technology framework. Easily extendable and designed as a multitude of libraries, LLVM provides a smooth experience for compiler newcomers and reduces the steep learning curve often associated with compiler development. To start, this book will show you how to configure, build, and install LLVM libraries, tools, and external projects. Next, you will be introduced to LLVM design and how it works in practice throughout each LLVM compiler frontend, IR, backend, the JIT engine, cross-compilation capabilities, and the plugin interface. With multiple hands-on examples and source code snippets, Getting Started with LLVM Core Libraries ensures a solid and smooth first step into the LLVM compiler development environment.

Paperback

First published January 1, 2014

32 people are currently reading
75 people want to read

About the author

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
8 (22%)
4 stars
14 (38%)
3 stars
8 (22%)
2 stars
3 (8%)
1 star
3 (8%)
Displaying 1 - 7 of 7 reviews
1 review
September 15, 2017
Good to understand major components of llvm, including clang frontend and llvm code generator.
1 review1 follower
January 2, 2015
This book is a great, practical manual of LLVM project. It covers LLVM core source code with the most important external projects. It doesn't cover the source code line by line, but lists the most important classes and explains their role in the compiler tool chain. The book explains LLVM infrastructure starting from very abstract compiler concepts. Therefore it is a great piece of literature for people who want to get an overview of basics of compilers, but do not have a time to read details. The book starts with instructions on how to install the LLVM. It then follows the organization of LLVM itself: from the front end, over LLVM IR, to back-end. In each of these it briefly explains associated concept of compiler. After explaining certain concept, it fast dives into the source code, explaining how things are programmed in LLVM. Such approach is great for developers who want to use LLVM infrastructure for developing external tools. This book demonstrates how certain libraries can be reused from LLVM in order to start developing own tools. I really like simple instructions for installing the LLVM, as well as the explanation of the installation and usage of external LLVM projects such as DragonEgg and Compiler-RT. LLVM with Clang has a big database of tools and options which can be used with these tools. This book is doing an excellent job on listing the most important tools/options with examples and command line code. LLVM IR is explained in details. Also, LLVM back-end and LLVM JIT are explained with nice amount of details.

The book contains fair amount of block diagrams which illustrate the LLVM and compiler procedures in a simple, but a clear manner. It is well structured, for this amount of details. It also contains useful links for additional explanations and projects. Authors have gathered a lot of empirical knowledge and sets of best-use practice. For sure, this will make your start with LLVM faster and straightforward as it can be.

If you are starting with LLVM, or you are a developer who is using LLVM and wants to develop own tools based on LLVM, this is a definitely book for you. High level concept explanations are brief, code instructions are detailed and are mostly explained with examples. Explanations are made for MAC, Linux and Windows.

LLVM and Clang still have some challenges when it comes to their functioning on Windows. Unfortunately, for some problems that I have encountered using LLVM so far, I didn't find explanations in this book (e.g. trying to install the LLVM from command line, using c++ libraries, etc.). While LLVM JIT is explained in details, LLVM interpreter is only mentioned. When basic compiler concepts are explained, there is a quick jump to LLVM concepts and code. However, I have a feeling that LLVM concepts are explained with coding in mind. For developers, this is great. For people who are interested in architecture, this might not be enough.
Profile Image for Evgeny Astigeevich.
1 review
November 24, 2014
I've recently started working with Clang/LLVM tools. I read the documentation from the LLVM web site and watched videos from LLVM-related conferences. The major problem is that most information is out of date. You need to look at many places to get your code working.

The book is exactly what is written in its title: getting started. It give basics of each major part of LLVM. After reading it you will be able to build it from scratch. What is most important the book shows in details how components of LLVM are built into a compiler toolchain: from front-end (clang) to back-end (optimizer and code generation). It's demonstrated that the LLVM framework is designed as a perfect modular system which allows easily adapting it for the custom projects.

The book is for people who understand internals of a compiler and how a compiler toolchain is organized. It does not focus on this. Of course you can use it in addition to your CS course to see how theoretical ideas in compiler engineering are implemented practically. Bare in mind the book is only the first step to be good at LLVM. A valuable feature of the book is links to related documentation on the LLVM site.

I've got this book in two formats: PDF and ePub. The first I use on my desktop. The second I read on iPad. The PDF version is my favourite. Examples in the ePub version look messed due to word wrapping.

Why did I give 4 instead of 5? The price is a little bit high for such a book. The book will be out of date in a year - two. The LLVM project is evolving very fast. Another thing is lack of details of LLVM structures, API and design decisions. I guess they were limited by the size of the book and time. The official LLVM site also has the same problem.

Anyway this is a good book to quickly start digging into LLVM.

My book came form the publisher site http://bit.ly/1swdanB where source code of examples can be found.
1 review
January 2, 2015
Excellent book to get started with LLVM.

Beginning with very basic things like getting the source code and the original documentation to let you build everything from scratch, the book quickly lets you dig into various parts of the toolchain, enabling you to use parts of them for your own purposes.

However, the book uses the 3.4 version, giving some hints regarding the actual 3.5 version - so if you want to walk through the book without surprises, I recommend to use the 3.4 version of LLVM first and update later. - Be aware, that if you bootstrap the toolchain, your current compiler might also have some impact on how smoothly you get through the build process.

So if you want to install LLVM and get a good understanding of how the various parts work together then this is the book that you have been waiting for.

However, I also recommend it If you are looking for a book that lets you get a deeper insight of various central mechanisms and data-structures of LLVM, just skip the very basic parts.

Well, I have learned a lot, so I definitely recommend it!
Profile Image for Kenneth Miller.
34 reviews4 followers
Read
September 9, 2015
This is a very brief book for the substantial material actually being covered. It included examples and certainly is expansive. But it seems that the authoritative source for LLVM documentation for avid readers is the actual hosted material, which not only includes in depth resources on anything you could want to know about LLVM, but also replete, up to date, examples. In addition, looking at any of the optional compiler passes that you might want to work or learn from is a really excellent approach for learning llvm. Quite a bit of what this book contains is incidentally available on the documentation mentioned above for LLVM; I don't have a catalogue of which information the other has that is exclusive.
Profile Image for Sandeep.
1 review1 follower
November 30, 2014
One of the problems that I faced with the online tutorials is that many of them are not updated to the recent version and the information seems to be scattered and there is no clear guidance on where to start from. This book is the first of its kind to give the most updated information also covering up the most basic requirement. Also it is a very good tutorials for learning llvm IR as it explains that with many good choozen examples. For those interested in learning the back end of the compiler this book is an excellent start.
Overall i liked this book because of the depth it covers with good lucidity.
7 reviews1 follower
May 23, 2016
Maybe more a criticism of the framework it self but I did find this book quite difficult to navigate and not really feeling like it contained enough examples - I would've preferred a more hands-on approach but I think this is probably just personal preference. Still very helpful.

---

Looking over the reviews other people didn't seem to have this problem. Either way I felt relieved when I found it because it was easier than relying solely on the documentation and was a useful purchase.
Displaying 1 - 7 of 7 reviews

Can't find what you're looking for?

Get help and learn more about the design.