Static Analysis

Volume 1694 of the series Lecture Notes in Computer Science pp 232-247


Detecting Equalities of Variables: Combining Efficiency with Precision

  • Oliver RüthingAffiliated withDepartment of Computer Science, University of Dortmund
  • , Jens KnoopAffiliated withDepartment of Computer Science, University of Dortmund
  • , Bernhard SteffenAffiliated withDepartment of Computer Science, University of Dortmund

* Final gross prices may vary according to local VAT.

Get Access


Detecting whether different variables have the same value at a program point is generally undecidable. Though the subclass of equalities, whose validity holds independently from the interpretation of operators (Herbrand-equivalences), is decidable, the technique which is most widely implemented in compilers, value numbering, is restricted to basic blocks. Basically, there are two groups of algorithms aiming at globalizations of value numbering: first, a group of algorithms based on the algorithm of Kildall, which uses data flow analysis to gather information on value equalities. These algorithms are complete in detecting Herbrand-equivalences, however, expensive in terms of computational complexity. Second, a group of algorithms influenced by the algorithm of Alpern, Wegman and Zadeck. They do not fully interpret the control flow, which allows them to be particularly efficient, however, at the price of being significantly less precise than their Kildall-like counterparts. In this article we discuss how to combine the best features of both groups by aiming at a fair balance between computational complexity and precision. We propose an algorithm, which extends the one of Alpern, Wegman and Zadeck. The new algorithm is polynomial and, in practice, expected to be almost as efficient as the original one. Moreover, for acyclic control flow it is as precise as Kildall’s one, i. e. it detects all Herbrand-equivalences.