Correctness of Classical Compiler Optimizations using CTL

In this paper, global compiler optimizations are captured by conditional rewrite rules of the form ( I ⇒ I' if φ ), where I and I' are program instructions and φ is a condition expressed in a variant of CTL, a formalism well suited to describe properties involving the control flow of a given program. The goal: to formally prove that if the condition φ is satisfied, then the rewrite rule I ⇒ I' can be applied to the program without changing the semantics of the program. Once a rewrite rule has been proven correct, it can be directly and automatically utilized in an optimizing compiler. The framework is based on joint work with David Lacey, Neil Jones and Eric Van Wyk [6]. The present paper presents a slightly simplified version of the framework, with emphasis on the CTL variants relation to CTL, along with a correctness proof of a transformation eliminating recomputations of available expressions.