Table of Contents
Fetching ...

A Formal Semantics of the GraalVM Intermediate Representation

Brae J. Webb, Mark Utting, Ian J. Hayes

TL;DR

A semantics for GraalVM's IR within Isabelle/HOL is described and a suite of canonicalization optimizations and conditional elimination optimizations are proved with respect to the semantics.

Abstract

The optimization phase of a compiler is responsible for transforming an intermediate representation (IR) of a program into a more efficient form. Modern optimizers, such as that used in the GraalVM compiler, use an IR consisting of a sophisticated graph data structure that combines data flow and control flow into the one structure. As part of a wider project on the verification of optimization passes of GraalVM, this paper describes a semantics for its IR within Isabelle/HOL. The semantics consists of a big-step operational semantics for data nodes (which are represented in a graph-based static single assignment (SSA) form) and a small-step operational semantics for handling control flow including heap-based reads and writes, exceptions, and method calls. We have proved a suite of canonicalization optimizations and conditional elimination optimizations with respect to the semantics.

A Formal Semantics of the GraalVM Intermediate Representation

TL;DR

A semantics for GraalVM's IR within Isabelle/HOL is described and a suite of canonicalization optimizations and conditional elimination optimizations are proved with respect to the semantics.

Abstract

The optimization phase of a compiler is responsible for transforming an intermediate representation (IR) of a program into a more efficient form. Modern optimizers, such as that used in the GraalVM compiler, use an IR consisting of a sophisticated graph data structure that combines data flow and control flow into the one structure. As part of a wider project on the verification of optimization passes of GraalVM, this paper describes a semantics for its IR within Isabelle/HOL. The semantics consists of a big-step operational semantics for data nodes (which are represented in a graph-based static single assignment (SSA) form) and a small-step operational semantics for handling control flow including heap-based reads and writes, exceptions, and method calls. We have proved a suite of canonicalization optimizations and conditional elimination optimizations with respect to the semantics.

Paper Structure

This paper contains 4 sections, 1 equation, 4 figures.

Figures (4)

  • Figure 1: An extract of the Isabelle datatype definition of the IR graph nodes (some node types and fields are omitted or abbreviated to save space).
  • Figure 2: Isabelle/HOL representation of Stamp information from GraalVM
  • Figure 3: Isabelle well-formedness graph invariants.
  • Figure 4: Data-flow semantics for a subset of nodes