Precondition Inference for Peephole Optimizations in LLVM
David Menendez, Santosh Nagarakatte

TL;DR
This paper introduces ALIVE-INFER, a data-driven method to automatically infer valid preconditions for peephole optimizations in LLVM, reducing manual effort and improving correctness.
Contribution
ALIVE-INFER automatically infers preconditions for LLVM peephole optimizations using a data-driven, predicate enumeration approach, improving correctness and reducing developer effort.
Findings
Generated preconditions weaker than LLVM's for 73 optimizations.
Successfully generalized 54 optimization patterns from Souper.
Demonstrated effectiveness in ensuring optimization validity.
Abstract
Peephole optimizations are a common source of compiler bugs. Compiler developers typically transform an incorrect peephole optimization into a valid one by strengthening the precondition. This process is challenging and tedious. This paper proposes ALIVE-INFER, a data-driven approach that infers preconditions for peephole optimizations expressed in Alive. ALIVE-INFER generates positive and negative examples for an optimization, enumerates predicates on-demand, and learns a set of predicates that separate the positive and negative examples. ALIVE-INFER repeats this process until it finds a precondition that ensures the validity of the optimization. ALIVE-INFER reports both a weakest precondition and a set of succinct partial preconditions to the developer. Our prototype generates preconditions that are weaker than LLVM's preconditions for 73 optimizations in the Alive suite. We also…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Parallel Computing and Optimization Techniques · Formal Methods in Verification
