Skip to main content
QUICK REVIEW

[Paper Review] Machine Learning in Compiler Optimisation

Zheng Wang, Michael O’Boyle|arXiv (Cornell University)|May 9, 2018
Parallel Computing and Optimization TechniquesComputer Science169 references19 citations
TL;DR

This paper presents a comprehensive survey of machine learning in compiler optimization, framing it as an evidence-based approach to automate and improve code transformation decisions. It details how supervised learning models use program features to predict optimal compiler optimizations, enabling adaptive, platform-aware compilation while reducing reliance on handcrafted heuristics and opening new avenues for innovation in compiler research.

ABSTRACT

In the last decade, machine learning based compilation has moved from an an obscure research niche to a mainstream activity. In this article, we describe the relationship between machine learning and compiler optimisation and introduce the main concepts of features, models, training and deployment. We then provide a comprehensive survey and provide a road map for the wide variety of different research areas. We conclude with a discussion on open issues in the area and potential research directions. This paper provides both an accessible introduction to the fast moving area of machine learning based compilation and a detailed bibliography of its main achievements.

Motivation & Objective

  • To establish machine learning as a mainstream, evidence-based methodology for compiler optimization, moving beyond heuristic-based approaches.
  • To address the growing complexity of modern hardware and the widening performance gap by automating optimization decisions using data-driven models.
  • To provide a structured overview of machine learning applications in compilers, including feature representation, model types, and deployment strategies.
  • To identify open research challenges and future directions, such as learning program analysis and intermediate representations.
  • To demystify machine-learning-based compilation and demonstrate its potential to enhance creativity and robustness in compiler design.

Proposed method

  • Uses supervised machine learning to train models on historical program and performance data, where inputs are program features and outputs are optimization decisions or performance metrics.
  • Employs a two-stage pipeline: (1) training on labeled data from benchmark programs, and (2) deploying the trained model at compile time to guide optimization choices.
  • Leverages diverse machine learning models—including linear models, decision trees, random forests, and neural networks—depending on the complexity of the optimization task.
  • Relies on feature engineering to extract static and dynamic program characteristics (e.g., loop structures, data access patterns) that correlate with performance outcomes.
  • Applies transfer learning and auto-tuning techniques to adapt models across different hardware platforms and application domains.
  • Emphasizes experimental rigor by advocating for public sharing of training and test data to ensure reproducibility and peer review of results.

Experimental results

Research questions

  • RQ1How can machine learning be effectively applied to predict the most profitable compiler optimizations for a given program and target architecture?
  • RQ2What are the most effective features for representing programs in a way that enables accurate prediction of optimization outcomes?
  • RQ3To what extent can machine learning models generalize across different hardware platforms and application domains?
  • RQ4Can machine learning be used to learn not just optimization decisions, but also low-level analyses such as dataflow or pointer analysis?
  • RQ5How can the trustworthiness and interpretability of machine learning-based compilation be ensured, especially in safety-critical systems?

Key findings

  • Machine learning has evolved from a niche research topic to a mainstream approach in compiler optimization, enabling data-driven, automated decision-making.
  • Supervised learning models trained on program features can effectively predict optimal compiler flags, loop transformations, and parallelization strategies.
  • The use of machine learning reduces the burden on compiler writers by automating profitability analysis, allowing for more aggressive and innovative optimizations.
  • Despite its promise, model performance depends critically on the quality and representativeness of training data, making data curation a key challenge.
  • Machine learning models cannot invent new transformations or perform static analysis validation—they rely entirely on the correctness and completeness of input data and human-defined rules.
  • The field is poised for further growth, with open research directions including learning intermediate representations, program space mapping, and automated analysis.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.