Efficient Computation of Expressions with Common Subexpressions

Bhaskaram Prabhala, Ravi Sethi

Research output: Contribution to journalArticlepeer-review

6 Scopus citations


Previous results have shown that it is easy to generate optimal code from express,on trees, and that optimal code generauon becomes very difficult ff arbitrary common subexpress,ons are handled In this paper a class of expressions containing restricted common subexpressions from which optimal code can be generated effictentty is studied. These expressions are represented by a class of series-parallel graphs, which the authors call collapsible graphs, that mchide trees and are general enough to permit large common subexpresslons, but from which optmml code can be generated m polynomml time for a class of stack machines.

Original languageEnglish (US)
Pages (from-to)146-163
Number of pages18
JournalJournal of the ACM (JACM)
Issue number1
StatePublished - Jan 1 1980
Externally publishedYes


  • code generation
  • common subexpresslons
  • polynomml algorithm
  • regster allocaUon
  • series-parallel graphs
  • stack machines

ASJC Scopus subject areas

  • Software
  • Control and Systems Engineering
  • Information Systems
  • Hardware and Architecture
  • Artificial Intelligence

Cite this