## Tree-Based Code Optimization (1992)

Citations: | 1 - 0 self |

### BibTeX

@TECHREPORT{Mcconnell92tree-basedcode,

author = {Carl Mcconnell},

title = {Tree-Based Code Optimization},

institution = {},

year = {1992}

}

### OpenURL

### Abstract

Nearly all algorithms for code optimization use a control flow graph. In this thesis, I will show that with very minor restrictions on program structure, an abstract syntax tree can be used instead, leading to algorithms that are often much simpler than their graphbased counterparts. The conclusion is that abstract syntax trees, not control flow graphs, should be the fundamental data structure in code optimization. 1 Introduction Most optimizing compilers consist of a front-end that does syntactic and semantic analysis, and a back-end that does optimization and machine code generation [ASU86]. The main data structure in the front-end is an abstract syntax tree (AST), while in the back-end it is a control flow graph (CFG), which consists of nodes representing computations and edges representing control flow. Thus, code optimization operates on a data structure---the CFG---in which the program has essentially been "flattened" into a tangle of GOTOs (edges). Unlike an AST, a CFG c...