Iterative-Free Program Analysis

Mizuhito Ogawat, Zhenjiang Hu, Isao Sasano

Research output: Contribution to conferencePaper

3 Citations (Scopus)

Abstract

Program analysis is the heart of modern compilers. Most control flow analyses are reduced to the problem of finding a fixed point in a certain transition system, and such fixed point is commonly computed through an iterative procedure that repeats tracing until convergence. This paper proposes a new method to analyze programs through recursive graph traversals instead of iterative procedures, based on the fact that most programs (without spaghetti GOTO) have well-structured control flow graphs, graphs with bounded tree width. Our main techniques are; an algebraic construction of a control flow graph, called SP Term, which enables control flow analysis to be defined in a natural recursive form, and the Optimization Theorem, which enables us to compute optimal solution by dynamic programming. We illustrate our method with two examples; dead code detection and register allocation. Different from the traditional standard iterative solution, our dead code detection is described as a simple combination of bottom-up and top-down traversals on SP Term. Register allocation is more interesting, as it further requires optimality of the result. We show how the Optimization Theorem on SP Terms works to find an optimal register allocation as a certain dynamic programming.

Original languageEnglish
Pages111-123
Number of pages13
Publication statusPublished - 2003 Dec 1
Externally publishedYes
EventEighth ACM SIGPLAN International Conference on Functional Programming - Uppsala, Sweden
Duration: 2003 Aug 252003 Aug 29

Conference

ConferenceEighth ACM SIGPLAN International Conference on Functional Programming
CountrySweden
CityUppsala
Period03/8/2503/8/29

Keywords

  • Catamorphism
  • Control Flow Graph
  • Dynamic Programming
  • Program Analysis
  • Register Allocation
  • SP Term
  • Tree Width

ASJC Scopus subject areas

  • Software

Fingerprint Dive into the research topics of 'Iterative-Free Program Analysis'. Together they form a unique fingerprint.

  • Cite this

    Ogawat, M., Hu, Z., & Sasano, I. (2003). Iterative-Free Program Analysis. 111-123. Paper presented at Eighth ACM SIGPLAN International Conference on Functional Programming, Uppsala, Sweden.