Termination-Checking for LLVM Peephole Optimizations

  title={Termination-Checking for LLVM Peephole Optimizations},
  author={David Menendez and Santosh Nagarakatte},
  journal={2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE)},
Mainstream compilers contain a large number of peephole optimizations, which perform algebraic simplification of the input program with local rewriting of the code. These optimizations are a persistent source of bugs. Our recent research on Alive, a domain-specific language for expressing peephole optimizations in LLVM, addresses a part of the problem by automatically verifying the correctness of these optimizations and generating C++ code for use with LLVM. This paper identifies a class of non… 
Practical formal techniques and tools for developing LLVM’s peephole optimizations
This dissertation presents Alive, a domain-specific language for specifying peephole optimizations in LLVM, and the Alive-NJ toolkit, which automatically checks the correctness of integerand floating point-based optimizations.
Precondition Inference for Peephole Optimizations in LLVM
This paper proposes ALIVE-INFER, a data-driven approach that infers preconditions for peephole optimizations expressed in Alive, and demonstrates the applicability of this technique to generalize 54 optimization patterns generated by Souper, an LLVM~IR--based superoptimizer.
Alive-FP: Automated Verification of Floating Point Based Peephole Optimizations in LLVM
This paper proposes Alive-FP, an automated verification framework for floating point based peephole optimizations in LLVM that handles a class of floating point optimizations and fast-math optimizations involving signed zeros, not-a-number, and infinities, which do not result in loss of accuracy.
Alive-Infer: data-driven precondition inference for peephole optimizations in LLVM
This paper proposes Alive-Infer, a data-driven approach that infers preconditions for peephole optimizations expressed in Alive, and demonstrates the applicability of this technique to generalize 54 optimization patterns generated by Souper, an LLVM IR–based superoptimizer.
Loop Detection by Logically Constrained Term Rewriting
New criteria to find loops in logically constrained rewrite systems which are implemented in the tool Ctrl are presented, illustrating the usefulness of these criteria in three example applications: to finding loops in LLVM peephole optimizations, to detect looping executions of C programs, and to establish nontermination of integer transition systems.
Future Directions for Optimizing Compilers
The problem of making optimizing compilers faster, less buggy, and more capable of generating high-quality output is examined.
How software engineering research aligns with design science: a review
The design science lens helps emphasize the theoretical contribution of research output—in terms of technological rules—and reflect on the practical relevance, novelty and rigor of the rules proposed by the research.


Provably correct peephole optimizations with alive
Alive is presented, a domain-specific language for writing optimizations and for automatically either proving them correct or else generating counterexamples, and can be automatically translated into C++ code that is suitable for inclusion in an LLVM optimization pass.
Automatically proving the correctness of compiler optimizations
A technique for automatically proving compiler optimizations sound, meaning that their transformations are always semantics-preserving, and a domain-specific language, called Cobalt, is presented for implementing optimizations as guarded rewrite rules.
Compiler validation via equivalence modulo inputs
This work introduces equivalence modulo inputs (EMI), a simple, widely applicable methodology for validating optimizing compilers, and profiles a program's test executions and stochastically prune its unexecuted code to create a practical implementation.
VOC: A Methodology for the Translation Validation of OptimizingCompilers
There is a growing awareness, both in industry and academia, of the crucial role of formally verifying the translation from high-level source-code into low-level ob- ject code that is typically
Finding and understanding bugs in C compilers
Csmith, a randomized test-case generation tool, is created and spent three years using it to find compiler bugs, and a collection of qualitative and quantitative results about the bugs it found are presented.
Compiler testing via a theory of sound optimisations in the C11/C++11 memory model
A strategy to reduce the hard problem of hunting concurrency compiler bugs to differential testing of sequential code is designed and a tool that puts this strategy to work is built, identifying several mistaken write introductions and other unexpected behaviours in the latest release of the gcc compiler.
Translation validation for an optimizing compiler
A practical translation validation infrastructure, able to check the correctness of many of the transformations performed by a realistic compiler, can be implemented with about the effort typically required to implement one compiler pass.
A termination analyzer for Java bytecode based on path-length
This article presents the first existing termination analyzer for Java bytecode dealing with any kind of data structures dynamically allocated on the heap and which does not require any help or annotation on the part of the user.
Automated soundness proofs for dataflow analyses and transformations via local rules
Rhodium is presented, a new language for writing compiler optimizations that can be automatically proved sound, and has specified and automatically proven the soundness of all of Cobalt's optimizations plus a variety of optimizations not expressible in Cobalt.
Looper: Lightweight Detection of Infinite Loops at Runtime
When a running program becomes unresponsive, it is often impossible for a user to determine if the program is performing some useful computation or if it has entered an infinite loop. We present