Lecture 13: Implementing Register Allocation & Control Flow & Memory Management

Eelco Visser
Lecture | PDF
December 02, 2021

Implementing Register Allocation

Last week we looked at the approach for using graph coloring for register allocation, conceptually. This week we study Stratego code for implementing register allocation (for straigh line code). Register allocation consists of liveness analysis, building an interference graph from the results of that analysis, coloring the nodes of that graph, and finally applying the coloring result to the program.

Control Flow

We extend our compiler to handle boolean values and control flow constructs in the subject language. By desugaring the language we can reduce the constructs that the downstream compiler has to consider.

Memory Management

We make a start with the safety considerations of memory management and consider automated memory management techniques. We study a range of garbage collection algorithms and study their properties. To be continued next week.

Slides:

References

See the memory management slide for references.