Introducing LLVM IR
You already had a taste of LLVM IR in the snippets of previous chapters. In this section, we will define how to read and understand this IR by using its textual representation.
LLVM IR also supports a binary representation called bitcode, which is more compact than the textual representation and comes with some backward compatibility guarantees. While we touch on this briefly in the Textual versus binary format section, we do not expect that you will actively use this representation and thus keep its description to a minimum. In other words, we focus on the textual representation in this section.
The syntax of LLVM IR is straightforward and we only describe it at a high level, skipping some of the details. Indeed, at this point, we will not describe all the decorators that you can add, such as function attributes, metadata, and so on. Instead, we will focus on the core IR and give you the ropes to understand the things that we do not cover. For the complete...