Content deleted Content added
Identified an arithmetic expression as distribution |
|||
Line 1:
When [[Code generation|generating code]] for arithmetic expressions, the [[compiler]] has to decide which is the best way to translate the expression in terms of number of instructions used as well as number of registers needed to evaluate a certain subtree (especially if free registers are scarce). The so called '''Sethi-Ullman algorithm''' (also known as '''Sethi-Ullman numbering''') fulfills the property of producing code which needs the least number of instructions possible as well as the least number of storage references (under the assumption that at the most [[commutativity]] and [[associativity]] apply to the operators used, but distributive laws
==Simple Sethi-Ullman algorithm==
|