• Medientyp: E-Artikel
  • Titel: Alive-Infer: data-driven precondition inference for peephole optimizations in LLVM
  • Beteiligte: Menendez, David; Nagarakatte, Santosh
  • Erschienen: Association for Computing Machinery (ACM), 2017
  • Erschienen in: ACM SIGPLAN Notices, 52 (2017) 6, Seite 49-63
  • Sprache: Englisch
  • DOI: 10.1145/3140587.3062372
  • ISSN: 0362-1340; 1558-1160
  • Entstehung:
  • Anmerkungen:
  • Beschreibung: <jats:p>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 demonstrate the applicability of this technique to generalize 54 optimization patterns generated by Souper, an LLVM IR–based superoptimizer.</jats:p>