Skip to main content
QUICK REVIEW

[Paper Review] ProGraML: Graph-based Deep Learning for Program Optimization and Analysis

Chris Cummins, Zacharias V. Fisches|arXiv (Cornell University)|Mar 23, 2020
Software Engineering ResearchComputer Science55 references24 citations
TL;DR

ProGraML introduces a graph-based program representation derived from compiler intermediate representations (IRs) that captures control, data, and call dependencies as a directed attributed multigraph. Using Message Passing Neural Networks on this structure, it achieves state-of-the-art performance—94.0 F1 score—on core compiler analyses and outperforms prior methods on heterogeneous device mapping and program classification tasks.

ABSTRACT

The increasing complexity of computing systems places a tremendous burden on optimizing compilers, requiring ever more accurate and aggressive optimizations. Machine learning offers significant benefits for constructing optimization heuristics but there remains a gap between what state-of-the-art methods achieve and the performance of an optimal heuristic. Closing this gap requires improvements in two key areas: a representation that accurately captures the semantics of programs, and a model architecture with sufficient expressiveness to reason about this representation. We introduce ProGraML - Program Graphs for Machine Learning - a novel graph-based program representation using a low level, language agnostic, and portable format; and machine learning models capable of performing complex downstream tasks over these graphs. The ProGraML representation is a directed attributed multigraph that captures control, data, and call relations, and summarizes instruction and operand types and ordering. Message Passing Neural Networks propagate information through this structured representation, enabling whole-program or per-vertex classification tasks. ProGraML provides a general-purpose program representation that equips learnable models to perform the types of program analysis that are fundamental to optimization. To this end, we evaluate the performance of our approach first on a suite of traditional compiler analysis tasks: control flow reachability, dominator trees, data dependencies, variable liveness, and common subexpression detection. On a benchmark dataset of 250k LLVM-IR files covering six source programming languages, ProGraML achieves an average 94.0 F1 score, significantly outperforming the state-of-the-art approaches. We then apply our approach to two high-level tasks - heterogeneous device mapping and program classification - setting new state-of-the-art performance in both.

Motivation & Objective

  • Address the limitations of sequential and ad-hoc program representations in machine learning for program analysis.
  • Close the performance gap between machine learning-based heuristics and optimal compiler optimizations by improving representational fidelity and model expressiveness.
  • Develop a compiler-independent, language-agnostic program representation that captures rich semantic structure for deep learning models.
  • Enable end-to-end learning of complex program analyses—such as liveness, dominator trees, and common subexpression detection—using graph neural networks.
  • Demonstrate the generalizability of the approach on high-level tasks like heterogeneous device mapping and program classification, achieving new state-of-the-art results.

Proposed method

  • Construct ProGraML as a directed attributed multigraph from LLVM and XLA IRs, encoding control, data, and call dependencies between instructions.
  • Represent each instruction and operand with rich features including opcode, data types, modifiers, and ordering to preserve semantic information.
  • Apply Message Passing Neural Networks (MPNNs) to propagate latent representations through the graph, enabling per-instruction and per-variable classification.
  • Train models end-to-end on whole-program graphs to perform downstream tasks such as control flow reachability, data dependency detection, and liveness analysis.
  • Use a unified graph representation that supports both low-level IRs and high-level program understanding tasks, enabling transfer learning across domains.
  • Leverage the structural similarity between ProGraML and traditional compiler IRs to ensure compatibility with existing compilation pipelines and tools.

Experimental results

Research questions

  • RQ1Can a graph-based program representation derived from compiler IRs outperform sequence-based or ad-hoc feature-based representations in learning program semantics?
  • RQ2To what extent can message passing neural networks approximate classical compiler analyses like dominator trees and liveness without handcrafted heuristics?
  • RQ3How does the expressiveness of ProGraML compare to existing graph-based representations such as CDFGs and IR2Vec in modeling program behavior?
  • RQ4Can ProGraML generalize to high-level optimization tasks such as heterogeneous device mapping and program classification, achieving state-of-the-art performance?
  • RQ5What is the scalability and inference efficiency of ProGraML compared to prior approaches in real-world compiler workloads?

Key findings

  • ProGraML achieves a 94.0 F1 score on a benchmark of 250k LLVM-IR files across six programming languages, significantly outperforming state-of-the-art methods on traditional compiler analyses.
  • The model demonstrates superior performance on variable liveness and common subexpression detection, where prior methods fail due to insufficient representation of operand semantics.
  • ProGraML sets a new state-of-the-art on heterogeneous device mapping, showing that graph-based learning can effectively reason about data locality and execution targets.
  • The approach achieves 76.6× higher inference throughput than a comparable CDFG-based method, suggesting strong practical scalability despite similar computational complexity.
  • The graph representation enables accurate modeling of long-range dependencies and semantic relationships across large codebases, overcoming limitations of sequential models.
  • The framework generalizes well across diverse programming languages and optimization tasks, indicating broad applicability beyond specific compiler passes.

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.