Search papers, labs, and topics across Lattice.
The paper introduces E-Path, a novel data structure for equality saturation that operates directly on control-flow graphs (CFGs) by representing equivalence between instruction sequences. This approach avoids the need to normalize CFGs into tree-like forms, enabling optimization of loops and other control-flow structures. The prototype implementation, instantiated over a restricted ANF-based CFG, demonstrates the feasibility of expressing classical CFG optimizations as rewrite-driven transformations without destructive mutation.
Ditch the tree: E-Path lets compilers optimize messy control-flow graphs directly via equality saturation, unlocking new rewrite possibilities.
Modern equality saturation systems excel at expression-level rewrites by exploring large spaces of equivalent programs without suffering from the phase-ordering problem. How- ever, these systems struggle to represent equivalence directly over arbitrary control-flow graphs, often requiring normal- ization into structured or tree-like forms before optimization can occur. We present the E-Path data structure, a prototype frame- work for equality-saturation-style optimization over control- flow graphs. Instead of representing congruence between individual expressions, the E-Path records equivalence be- tween instruction sequences embedded within a compiler intermediate representation. In this prototype, E-Path is in- stantiated over a restricted ANF-based control-flow graph used in a compiler backend, but the model itself is intended to be IR-agnostic. By treating instruction sequences as the fundamental unit of congruence, the E-Path enables non-destructive optimiza- tion of loops and other control-flow structures while preserv- ing multiple equivalent program variants simultaneously. This allows classical CFG optimizations to be expressed as rewrite-driven transformations without destructive mutation of the underlying graph.