Provably Correct Peephole Optimizations with Alive

Nuno P. Lopes, David Menendez, Santosh Nagarakatte, John Regehr

 

Abstract:

Compilers should not miscompile. Our work addresses problems in developing peephole optimizations that perform local rewriting to improve the efficiency of LLVM code. These optimizations are individually difficult to get right, particularly in the presence of undefined behavior; taken together they represent a persistent source of bugs. This paper presents Alive, a domain-specific language for writing optimizations and for automatically either proving them correct or else generating counterexamples. Furthermore, Alive can be automatically translated into C++ code that is suitable for inclusion in an LLVM optimization pass. Alive is based on an attempt to balance usability and formal methods; for example, it captures—but largely hides—the detailed semantics of three different kinds of undefined behavior in LLVM. We have translated more than 300 LLVM optimizations into Alive and, in the process, found that eight of them were wrong.

 

Published:

N. P. Lopes, D. Menendez, S. Nagarakatte, J. Regehr. Provably Correct Peephole Optimizations with Alive. In Proc. of the 36th annual ACM SIGPLAN conference on Programming Language Design and Implementation (PLDI), June 2015 (Distinguished Paper Award, SIGPLAN Research Highlight).

 

Download:

 

Bibtex:

@inproceedings{alive-pldi15,
  title =	{Provably Correct Peephole Optimizations with Alive},
  author =	{Nuno P. Lopes and David Menendez and Santosh Nagarakatte and John Regehr},
  booktitle =	{Proc. of the 36th annual ACM SIGPLAN conference on Programming Language Design and Implementation (PLDI)},
  doi =		{10.1145/2737924.2737965},
  month =	jun,
  year =	2015
}

 

Copyright notice:

© ACM, 2015. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution.

 

<-- Return