Many valuable flow analysis algorithms never make their way into the optimization phase of a compiler because they are difficult to build and maintain. A major problem is the lack of suitable high-level abstractions for implementing analyzers. This report provides such an abstraction based on the directed graph, describes a programming language based on this formalism, and shows that it makes the implementation and use of analysis algorithms easy.
The report introduces the idea of viewing a flow analyzer as a graph transformer, motivating the choice of graphs as an underlying data type. A family of powerful yet easily specified primitive graph transformations based on a pattern-match and replacement paradigm is presented, along with an algorithm for performing graph pattern-matching. Implementations of some of the most complex analysis algorithms known are presented, showing that a language based on graphs and graph transformations is sufficient for performing flow analysis. This approach successfully addresses many of the difficulties commonly encountered building and combining analyzers without affecting the asymptotic time bounds of any algorithm thus implemented.
The system, including a library of pre-programmed reusable analyzers has been incorporated into a pre-existing compiler optimizer, replacing a hand-coded analyzer. Within this experimental setting, it is demonstrated that the system greatly facilitates the implementation and use of analyzers, that different algorithms for solving the same problem can be interchanged easily without disturbing the surrounding compiler, and that multiple algorithms can coexist and interact without the need for any special interfaces.
Title
Graph Transformations and Program Flow Analysis
Published
1990-12-01
Full Collection Name
Electrical Engineering & Computer Sciences Technical Reports
Other Identifiers
CSD-91-620
Type
Text
Extent
136 p
Archive
The Engineering Library
Usage Statement
Researchers may make free and open use of the UC Berkeley Library’s digitized public domain materials. However, some materials in our online collections may be protected by U.S. copyright law (Title 17, U.S.C.). Use or reproduction of materials protected by copyright beyond that allowed by fair use (Title 17, U.S.C. § 107) requires permission from the copyright owners. The use or reproduction of some materials may also be restricted by terms of University of California gift or purchase agreements, privacy and publicity rights, or trademark law. Responsibility for determining rights status and permissibility of any use or reproduction rests exclusively with the researcher. To learn more or make inquiries, please see our permissions policies (https://www.lib.berkeley.edu/about/permissions-policies).