## Formal Verification of Transformations for Peephole Optimization (1997)

Venue: | IN FME '97: FORMAL METHODS: THEIR INDUSTRIAL APPLICATION AND STRENGTHENED FOUNDATIONS, LECTURE NOTES IN COMPUTER SCIENCE |

Citations: | 3 - 1 self |

### BibTeX

@INPROCEEDINGS{Dold97formalverification,

author = {A. Dold and F. W. Von Henke and H. Pfeifer and H. Rueß},

title = {Formal Verification of Transformations for Peephole Optimization},

booktitle = {IN FME '97: FORMAL METHODS: THEIR INDUSTRIAL APPLICATION AND STRENGTHENED FOUNDATIONS, LECTURE NOTES IN COMPUTER SCIENCE},

year = {1997},

pages = {459--472},

publisher = {Springer}

}

### OpenURL

### Abstract

In this paper we describe a formal verification of transformations for peephole optimization using the PVS system [12]. Our basic approach is to develop a generic scheme to mechanize these kinds of verifications for a large class of machine architectures. This generic scheme is instantiated with a formalization of a non-trivial stack machine [14] and a PDP-11 like two-address machine [2], and we prove the correctness of more than 100 published peephole optimization rules for these machines. In the course of verifying these transformations we found several errors in published peephole transformation steps [14]. From the information of failed proof attempts, however, we were able to discover strengthened preconditions for correcting the erroneous transformations.

### Citations

532 | PVS: a Prototype Verification System
- Owre, Rushby, et al.
- 1992
(Show Context)
Citation Context ...eephole optimization. Moreover, corrected applicability conditions were discovered through formal proof. In this paper we present a generic scheme for formally verifying peephole optimizations in PVS =-=[13]-=- and use this scheme to formally prove correct sets of peephole optimizations for different machines. The purpose of the scheme is to provide a tool for simplifying the verification and administration... |

306 | Formal verification for fault-tolerant architectures: Prolegomena to the design of PVS
- Owre, Rushby, et al.
- 1995
(Show Context)
Citation Context ...m.de To be presented at FME'97, University of Graz, Austria. September 1997 Abstract. In this paper we describe a formal verification of transformations for peephole optimization using the PVS system =-=[12]-=-. Our basic approach is to develop a generic scheme to mechanize these kinds of verifications for a large class of machine architectures. This generic scheme is instantiated with a formalization of a ... |

84 | A tutorial introduction to PVS
- Crow, Owre, et al.
- 1995
(Show Context)
Citation Context ...ection 3 is quite similar to Windley's specification of the assembly language level (macro level). 2 A Brief Description of PVS This section provides a brief overview of PVS. For more details consult =-=[1, 12]-=-. The PVS system combines an expressive specification language with an interactive proof checker. The PVS specification language builds on classical typed higher-order logic with the usual base types,... |

47 |
The Design and Application of a Retargetable Peephole Optimizer
- Davidson, Fraser
- 1980
(Show Context)
Citation Context ...e kinds of verifications for a large class of machine architectures. This generic scheme is instantiated with a formalization of a non-trivial stack machine [14] and a PDP-11 like two-address machine =-=[2]-=-, and we prove the correctness of more than 100 published peephole optimization rules for these machines. In the course of verifying these transformations we found several errors in published peephole... |

26 |
Using peephole optimization on intermediate code
- Tanenbaum, Staveren, et al.
- 1982
(Show Context)
Citation Context ... develop a generic scheme to mechanize these kinds of verifications for a large class of machine architectures. This generic scheme is instantiated with a formalization of a non-trivial stack machine =-=[14]-=- and a PDP-11 like two-address machine [2], and we prove the correctness of more than 100 published peephole optimization rules for these machines. In the course of verifying these transformations we ... |

24 |
Register Allocation and Exhaustive Peephole Optimization
- Davidson, Fraser
- 1994
(Show Context)
Citation Context ... The machine is described by register and memory transfers. Their optimizer is enhanced further using a simple data-flow analysis about which resources are accessed or modified by an instruction pair =-=[3]-=-, and by automatically generating rules from a test set [4]. Tanenbaum's peephole optimizer [14] operates on a stack-machine-based intermediate code suitable for imperative languages and several machi... |

15 | Peep – An Architectural Description Driven Peephole Optimizer - Kessler - 1984 |

13 | A theory of generic interpreters - Windley - 1993 |

9 |
Automatic Inference and Fast Interpretation of Peephole Optimization Rules', Software---Practice
- Davidson, Fraser
- 1987
(Show Context)
Citation Context ... Their optimizer is enhanced further using a simple data-flow analysis about which resources are accessed or modified by an instruction pair [3], and by automatically generating rules from a test set =-=[4]-=-. Tanenbaum's peephole optimizer [14] operates on a stack-machine-based intermediate code suitable for imperative languages and several machine architec2 tures. A large set of optimizations is given i... |

9 | Verifying the correctness of compiler transformations on basic blocks using abstract interpretation
- McNerney
- 1991
(Show Context)
Citation Context ...ble including more than 100 rules (pattern/replacement pairs). In all these approaches, however, neither a formal machine semantics is provided nor are the transformations formally verified. McNerney =-=[11]-=- validates transformations on basic blocks by automatically enumerating a set of test programs p, then evaluating both p and its transformation using abstract interpretation. The transformation is mea... |

6 | Construction of a Peephole Optimizer - Lamb - 1981 |

5 | Specifying instruction-set architectures in HOL: A primer
- Windley
- 1994
(Show Context)
Citation Context ...o check this property and used it to validate the register allocation phase of his compiler. It is not clear how his prover can be reused to verify transformations for other target languages. Windley =-=[15, 16]-=- also uses generic schemes but in the realm of hardware verification. He models microprocessors on different levels of abstraction using a generic state transition system (interpreter) to represent ea... |

4 | Microprocessor verification: A tutorial
- Coe, Windley
- 1994
(Show Context)
Citation Context ...chine with different addressing modes [2], and proved all the optimization steps for this machine as stated in [2] to be correct [5]. In addition, we instantiated the generic scheme with the Tamarack =-=[17]-=- micro-processor and verified peephole optimization rules for this processor. In [5], however, we used an older version of PVS which did not provide powerful builtin proof strategies such as GRIND. Th... |

2 | Discovering Machine Specific Code Improvements - Kessler - 1986 |

1 |
A Generic Specification for Verifying Peephole Optimizations
- Dold, Henke, et al.
- 1995
(Show Context)
Citation Context ...tiated this scheme with a formalization of a PDP-11 like two-address machine with different addressing modes [2], and proved all the optimization steps for this machine as stated in [2] to be correct =-=[5]-=-. In addition, we instantiated the generic scheme with the Tamarack [17] micro-processor and verified peephole optimization rules for this processor. In [5], however, we used an older version of PVS w... |

1 | Generic Compilation Schemes for Simple Programming Constructs
- Dold, Henke, et al.
- 1996
(Show Context)
Citation Context ...from an intermediate language into DEC Alpha code. In addition, it has been utilized to specify and verify the compilation of standard imperative language constructs into code of an arbitrary machine =-=[6]-=-. To implement conditionals and while loops, jump instructions have been added to the linear code, and an interpreter for this code has been provided. Our linear interpreter presented in this paper ha... |

1 | A Novel Approach Towards Peephole Optimisations - Gill - 1991 |