Iterative-free program analysis

Mizuhito Ogawa, Zhenjiang Hu, Isao Sasano

Research output: Contribution to journalArticle

5 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
Pages (from-to)111-123
Number of pages13
JournalACM SIGPLAN Notices
Volume38
Issue number9
Publication statusPublished - 2003 Sep
Externally publishedYes

Fingerprint

Flow graphs
Dynamic programming
Flow control

Keywords

  • Catamorphism
  • Control flow graph
  • Dynamic programming
  • Program analysis
  • Register allocation
  • SP term
  • Tree width

ASJC Scopus subject areas

  • Computer Graphics and Computer-Aided Design
  • Software

Cite this

Ogawa, M., Hu, Z., & Sasano, I. (2003). Iterative-free program analysis. ACM SIGPLAN Notices, 38(9), 111-123.

Iterative-free program analysis. / Ogawa, Mizuhito; Hu, Zhenjiang; Sasano, Isao.

In: ACM SIGPLAN Notices, Vol. 38, No. 9, 09.2003, p. 111-123.

Research output: Contribution to journalArticle

Ogawa, M, Hu, Z & Sasano, I 2003, 'Iterative-free program analysis', ACM SIGPLAN Notices, vol. 38, no. 9, pp. 111-123.
Ogawa M, Hu Z, Sasano I. Iterative-free program analysis. ACM SIGPLAN Notices. 2003 Sep;38(9):111-123.
Ogawa, Mizuhito ; Hu, Zhenjiang ; Sasano, Isao. / Iterative-free program analysis. In: ACM SIGPLAN Notices. 2003 ; Vol. 38, No. 9. pp. 111-123.
@article{2176e283b83f41e9ac5cfda2a079d35f,
title = "Iterative-free program analysis",
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.",
keywords = "Catamorphism, Control flow graph, Dynamic programming, Program analysis, Register allocation, SP term, Tree width",
author = "Mizuhito Ogawa and Zhenjiang Hu and Isao Sasano",
year = "2003",
month = "9",
language = "English",
volume = "38",
pages = "111--123",
journal = "SIGPLAN Notices (ACM Special Interest Group on Programming Languages)",
issn = "1523-2867",
publisher = "Association for Computing Machinery (ACM)",
number = "9",

}

TY - JOUR

T1 - Iterative-free program analysis

AU - Ogawa, Mizuhito

AU - Hu, Zhenjiang

AU - Sasano, Isao

PY - 2003/9

Y1 - 2003/9

N2 - 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.

AB - 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.

KW - Catamorphism

KW - Control flow graph

KW - Dynamic programming

KW - Program analysis

KW - Register allocation

KW - SP term

KW - Tree width

UR - http://www.scopus.com/inward/record.url?scp=1442337722&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=1442337722&partnerID=8YFLogxK

M3 - Article

AN - SCOPUS:1442337722

VL - 38

SP - 111

EP - 123

JO - SIGPLAN Notices (ACM Special Interest Group on Programming Languages)

JF - SIGPLAN Notices (ACM Special Interest Group on Programming Languages)

SN - 1523-2867

IS - 9

ER -