In an optimization apparatus embedded in a compiler apparatus that compiles
a high-level language program to a machine language program, equivalence
relations among a plurality of expressions are analyzed in a short time
period by calculating an equivalent expression set group of each basic
block, the equivalent expression set group being composed of equivalent
expression sets with equivalence relations. Specifically, an equivalent
expression set group at the entry point of a basic block is calculated
from equivalent expression set groups at the exit points of basic blocks
that precede the basic block, and then an equivalent expression set group
at the exit point of the basic block is calculated from the equivalent
expression set group at the entry point of the basic block. These
calculations are repeated until there are no more changes to the
equivalent expression set group at the exit point of any of the basic
blocks.