LifeJacket: verifying precise floating-point optimizations in LLVM

@article{Ntzli2016LifeJacketVP,
  title={LifeJacket: verifying precise floating-point optimizations in LLVM},
  author={Andres N{\"o}tzli and Fraser Brown},
  journal={Proceedings of the 5th ACM SIGPLAN International Workshop on State Of the Art in Program Analysis},
  year={2016}
}
  • Andres Nötzli, Fraser Brown
  • Published 30 March 2016
  • Computer Science
  • Proceedings of the 5th ACM SIGPLAN International Workshop on State Of the Art in Program Analysis
Users depend on correct compiler optimizations but floating-point arithmetic is difficult to optimize transparently. Manually reasoning about all of floating-point arithmetic’s esoteric properties is error-prone and increases the cost of adding new optimizations. We present an approach to automate reasoning about precise floating-point optimizations using satisfiability modulo theories (SMT) solvers. We implement the approach in LifeJacket, a system for automatically verifying precise floating… 

Figures and Tables from this paper

Alive-FP: Automated Verification of Floating Point Based Peephole Optimizations in LLVM
TLDR
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.
Practical verification of peephole optimizations with Alive
TLDR
Alive is a domain-specific language for writing optimizations and for automatically either proving them correct or else generating counterexamples, which can be automatically translated into C++ code that is suitable for inclusion in an LLVM optimization pass.
Practical formal techniques and tools for developing LLVM’s peephole optimizations
TLDR
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.
Towards Verified, Constant-time Floating Point Operations
TLDR
CTFP is an efficient, machine-checked, and extensible system that transforms unsafe floating-point operations into safe, constant-time computations, and it is found that CTFP neither breaks real world applications nor incurs overwhelming overhead.
Icing: Supporting Fast-Math Style Optimizations in a Verified Compiler
Verified compilers like CompCert and CakeML offer increasingly sophisticated optimizations. However, their deterministic source semantics and strict IEEE 754 compliance prevent the verification of
Precondition Inference for Peephole Optimizations in LLVM
TLDR
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.
Floating-Point Shadow Value Analysis
TLDR
A novel program analysis technique is presented that emulates execution with alternative real number implementations at the binary level and also presents a Pin-based implementation of this technique that supports x86_64 programs and a variety of alternative representations.
CAnDL: a domain specific language for compiler analysis
TLDR
CAnDL is a constraint based language that operates over LLVM's intermediate representation that provides a uniform manner in which to describe compiler analysis and can be applied to a range of compiler analysis problems, reducing code length and complexity.
Translating AArch64 Floating-Point Instruction Set to the x86-64 Platform
TLDR
This paper extends mc2llvm, which is an LLVM-based retargetable 32-bit binary translator developed in the lab in the past several years, to support 64-bit ARM instruction set and adds support for the flush-to-zero mode, not-a-number processing, floating-point exceptions, and various rounding modes.
Alive-Infer: data-driven precondition inference for peephole optimizations in LLVM
TLDR
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.
...
...

References

SHOWING 1-10 OF 23 REFERENCES
Alive-FP: Automated Verification of Floating Point Based Peephole Optimizations in LLVM
TLDR
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.
Provably correct peephole optimizations with alive
TLDR
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.
Stochastic optimization of floating-point programs with tunable precision
TLDR
The ability to generate reduced precision implementations of Intel's handwritten C numeric library which are up to 6 times faster than the original code, and achieve end-to-end speedups by optimizing kernels that can tolerate a loss of precision while still remaining correct are demonstrated.
Verified Compilation of Floating-Point Computations
TLDR
This paper reports on the recent success in formally specifying and proving correct CompCert’s compilation of floating-point arithmetic and obtains the first formally verified compiler that provably preserves the semantics offloating-point programs.
Optgen: A Generator for Local Optimizations
TLDR
Optgen generates all local optimizations up to a given cost limit and verifies each rule using an SMT solver, guaranteeing correctness and completeness of the generated rule set.
Verifying bit-manipulations of floating-point
TLDR
The technique provides a method to compute an error bound of a given implementation with respect to its mathematical specification and is applied to Intel's implementations of transcendental functions and proves formal error bounds for these widely used routines.
Towards optimization-safe systems: analyzing the impact of undefined behavior
TLDR
A novel model is proposed, which views unstable code in terms of optimizations that leverage undefined behavior, and a new static checker called Stack is introduced that precisely identifies unstable code.
Sound compilation of reals
TLDR
This work presents a programming model where the user writes a program in a real-valued implementation and specification language that explicitly includes different types of uncertainties, and presents a compilation algorithm that generates a finite-precision implementation that is guaranteed to meet the desired precision with respect to real numbers.
An SMT-LIB Theory of Binary Floating-Point Arithmetic ∗
TLDR
This paper rigorously defines the semantics of FPA, following the IEEE binary floating-point standard 754-2008, and motivates the design decisions and deviations from the IEEE standard.
Efficient search for inputs causing high floating-point errors
TLDR
This paper develops a heuristic search algorithm called Binary Guided Random Testing (BGRT), and shows that while concrete-testing-based error estimation methods based on maintaining shadow values at higher precision can search out higher error-inducing inputs, suit able heuristicsearch guidance is key to finding higher errors.
...
...