Code Generation for Expressions with Common Subexpressions

@article{Aho1977CodeGF,
  title={Code Generation for Expressions with Common Subexpressions},
  author={Alfred V. Aho and Stephen C. Johnson and Jeffrey D. Ullman},
  journal={Journal of the ACM (JACM)},
  year={1977},
  volume={24},
  pages={146 - 160}
}
This paper shows the problem of generating optimal code for expressions containing common subexpressions is computationally difficult, even for simple expressions and simple machines. Some heuristics for code generation are given and their worst-case behavior is analyzed. For one register machines, an optimal code generation algorithm is given whose time complexity is linear in the size of an expression and exponential only in the amount of sharing. 
Further analysis of code generation for a single register machine
  • L. Carter
  • Computer Science
  • Acta Informatica
  • 2004
TLDR
A class of expressions with common subexpressions is introduced which can be optimally coded in quadratic time, and a new analysis of the exponential time bound is presented which more closely describes the complexity of the task of producing optimal code. Expand
Further Analysis of Code Generation for a Single Register Machine
TLDR
A class of expressions with common subexpressions is introduced which can be optimally coded in quadratic time, and a new analysis of the exponential time bound is presented which more closely describes the complexity of the task of producing optimal code. Expand
Efficient Computation of Expressions with Common Subexpressions
TLDR
(b) if the authors wish to avoid redundant computation of common subexpressions then generation of optimal code becomes very difficult, even for quite simple machines [3,9], so any theoretical results can at best provide insight into the design of code generators. Expand
A practical method for code generation based on exhaustive search
TLDR
An original method for code generation has been developed in conjunction with the construction of a compiler for the C programming language on the DEC-10 computer, and is table-driven, with most machine-specific information isolated in the tables. Expand
Factoring and eliminating common subexpressions in polynomial expressions
TLDR
This work presents algorithms to reduce the number of operations to compute a set of polynomial expression by factoring and eliminating common subexpressions, based on the algebraic techniques for multi-level logic synthesis. Expand
Factoring and eliminating common subexpressions in polynomial expressions
TLDR
This work presents algorithms to reduce the number of operations to compute a set of polynomial expression by factoring and eliminating common subexpressions, based on the algebraic techniques for multi-level logic synthesis. Expand
Optimizing Polynomial Expressions by Factoring and Eliminating Common Subexpressions
Polynomial expressions are used to compute a wide variety of mathematical functions commonly found in signal processing and graphics applications, which provide good opportunities for optimization.Expand
Optimized DSP assembly code generation starting from homogeneous atomic data flow graphs
  • B. Wess, W. Kreuzer
  • Computer Science
  • 38th Midwest Symposium on Circuits and Systems. Proceedings
  • 1995
TLDR
By transforming graphs into constrained expression trees, global optimized instruction code can be produced based on tree algorithms based on O(n) algorithms. Expand
Code-generation for machines with multiregister operations
TLDR
A linear-time optimal code generation algorithm is derived for a register-pair machine in which all registers are interchangeable, based on showing that for this model there is an optimal evaluation sequence with limited oscillation between the sub-trees dominated by the children of a given node. Expand
Optimal chaining in expression trees
TLDR
This work presents a linear-time scheduling algorithm for finding an optimal order of evaluation for a machine with a bounded number of registers and optimally uses this feature to compute (vector) expression trees. Expand
...
1
2
3
4
5
...

References

SHOWING 1-10 OF 43 REFERENCES
Optimal code generation for expression trees
TLDR
A dynamic programming algorithm is presented which produces optimal code for any machine in the class; this algorithm runs in time which is linearly proportional to the number of vertices in an expression tree. Expand
The Generation of Optimal Code for Stack Machines
TLDR
Efficient algorithms are given for constructing optimal programs in the case where the expressions are trees, there are no data dependencies, and the arithmetic expressions have limited algebraic properties. Expand
Code Generation for a One-Register Machine
TLDR
The problem of generating minimal-length code for such machines is hard in a precise sense; specifically it is shown that the problem is NP-complete. Expand
The Generation of Optimal Code for Arithmetic Expressions
TLDR
It is shown that the algorithms presented here also minimize the number of storage references in the evaluation, and they are shown to take the shortest possible number of instructions. Expand
Generation of optimal code for expressions via factorization
  • M. Breuer
  • Mathematics, Computer Science
  • CACM
  • 1969
TLDR
Methods are presented for increasing the efficiency of the object code produced by first factoring the expressions, i.e. finding a set of subexpressions each of which occurs in two or more other expressions or sub expressesions. Expand
Register Assignment Algorithm for Generation of Highly Optimized Object Code
TLDR
A register assignment algorithm is described that, in contrast to traditional methods, permits a high level of optimization at both local and global levels, with global assignment intervening. Expand
The Design of an Optimizing Compiler
TLDR
The design and implementation of a highly optimizing compiler for the BLISS language is described and a notational scheme is described in terms of which an overview of the compiler is presented. Expand
On the Sethi-Ullman algorithm
A directed acyclic graph (dag) can be used to represent an arithmetic expression consisting of sequences of binary operations on arguments. The Sethi-Ullman algorithm (Journal of the ACM, Vol. 17 No.Expand
Complete Register Allocation Problems
  • R. Sethi
  • Computer Science
  • SIAM J. Comput.
  • 1975
TLDR
The model used in this paper is a single processor with an arbitraril system that automates the very labor-intensive and therefore time-heavy and expensive process of register allocation. Expand
Register allocation via usage counts
TLDR
The paper compares register allocation based on usage counts to other commonly used register allocation techniques, and presents evidence which shows that the usage count technique is significantly better than these other techniques. Expand
...
1
2
3
4
5
...