Computer Science > Programming Languages
[Submitted on 18 Nov 2016 (v1), revised 1 Feb 2017 (this version, v2), latest version 25 Mar 2017 (v3)]
Title:Precondition Inference for Peephole Optimizations in LLVM
View PDFAbstract: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 PInfer, a data-driven approach for inferring preconditions for peephole optimizations expressed in Alive. PInfer generates positive and negatives examples for an optimization, enumerates predicates on-demand, and learns a set of predicates that separate the positive and negative examples. PInfer repeats this process until it finds a precondition that ensures the validity of the optimization. PInfer reports both the weakest precondition and a set of succinct partial preconditions to the developer. The PInfer prototype successfully generates either the partial precondition or the weakest precondition for 164 out of 174 peephole optimizations in the Alive suite. It also generates preconditions that are weaker than LLVM's precondition for 73 optimizations. We also demonstrate the applicability of this technique to generalize 54 concrete expression directed acyclic graphs generated by an LLVM IR-based super optimizer.
Submission history
From: Santosh Nagarakatte [view email][v1] Fri, 18 Nov 2016 05:21:00 UTC (3,390 KB)
[v2] Wed, 1 Feb 2017 00:45:58 UTC (3,406 KB)
[v3] Sat, 25 Mar 2017 01:58:45 UTC (3,418 KB)
References & Citations
Bibliographic and Citation Tools
Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)
Code, Data and Media Associated with this Article
alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)
Demos
Recommenders and Search Tools
Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.