Now, only the target machine is missing. With the target machine, we define the CPU architecture we’d like to generate…
The IR module is the brace around all elements we generate for a compilation unit. At the global level, we…
We are almost done with emitting the IR code for a function! We only need to put the pieces together…
The parameters of a function also need some consideration. First, we need to map the types of the source language…
Functions (and also global variables) have a linkage style attached. With the linkage style, we define the visibility of a…
In general, you translate expressions, as shown in Chapter 2, The Structure of a Compiler. The only interesting part is…
How can we optimize a phi instruction and why should we do it? Although the SSA form is advantageous for…
If the current basic block we are looking at has only one predecessor, then we search there for the value…
To generate IR code in SSA form from the AST, we can use an approach called AST numbering. The basic…
The conceptual idea of a basic block is that it is a linear sequence of instructions that are executed in…