FIRM—A Graph-Based Intermediate Representation

Matthias Braun, Sebastian Buchwald, Andreas Zwinkau. FIRM—A Graph-Based Intermediate Representation. In Florent Bouchez, Sebastian Hack, Eelco Visser, editors, Proceedings of the Workshop on Intermediate Representations. pages 61-68, 2011.


We present our compiler intermediate representation FIRM. Pro- grams are always in SSA form enabling a representation as graphs. We argue that this naturally encodes context information simplify- ing many analyses and optimisations. Instructions are connected by dependency edges relaxing the total to a partial order inside a basic block. For example alias analysis results can be directly encoded in the graph structure.

The paper gives an overview of the representation and focuses on its construction. We present a simple construction algorithm which does not depend on dominance frontiers or a dominance tree. We prove that for reducible programs it produces a program in pruned and minimal SSA-form. The algorithm works incrementally so optimisations like copy propagation and constant folding can be performed on-the-fly during the construction.