Here comes the Machine IR
If you’ve already followed the logs that were produced by the print-before-all
or print-after-all
option (see Chapter 10) to the assembly code, then you’ve already encountered the Machine IR.
Indeed, any transformation that runs after the instruction selection pass produces the Machine IR. Figure 11.1 illustrates the whole compilation process and mentions where the Machine IR appears:

Figure 11.1 shows the input file (input.c
) going through the frontend and being converted into the LLVM IR. Then, the backend takes over and starts by performing a sequence of LLVM IR to LLVM IR transformations. This sequence is, as you know, called the middle-end. Next, the backend runs the instruction selection pass, which translates the LLVM IR into Machine IR. This marks the beginning of the backend part of the backend (confusing, we know!). From this point forward, all the remaining passes...