Julia's UnifiedIR: A Decade-Late Overhaul of the Compiler IR
Keno's PR proposes UnifiedIR, a dialect-aware, region-based IR to replace Julia's aging compiler data structures, aiming for extensibility and ecosystem unification.

Keno Fischer has opened a significant pull request against the Julia compiler — PR #62334 — that proposes a ground-up replacement of the language's internal IR data structures. The existing IR, now roughly ten years old, has become a bottleneck for both compiler development and ecosystem tooling.
What's Broken
The current IR suffers from three major issues: it's hard to use due to poor API design and ownership semantics; it's not extensible, forcing downstream projects to either hack around limitations or build their own IR from scratch; and it was never designed as an external-facing system. The result is fragmentation and technical debt across the Julia compiler and its ecosystem.
UnifiedIR: The Replacement
UnifiedIR is a new top-level package that sits alongside Compiler, JuliaSyntax, and JuliaLowering. It provides a self-contained, extensible set of IR data structures and operations. The design is dialect-aware and region-based, similar to MLIR, but retains elements of the original Julia IR that worked well.
The PR aims to replace the following existing data structures:
- SyntaxTree (from JuliaSyntax)
- SyntaxGraph (from JuliaSyntax/Lowering)
- CodeInfo (for inference; codegen and interpreter are future targets)
- IRCode
- Various ecosystem IRs
Core Architecture
The core data structure provides an efficient IR representation with core utilities. Users can extend it with additional columns (one per statement) and layered views for specific applications. Currently defined views include:
- An IncrementalCompact-like extension for fast one-pass replacement passes
- An LLVM-like view using linked lists for easier CFG transforms, with a novel order-maintenance algorithm co-developed with Claude to avoid quadratic behavior
- A graph embedding for array compilers and lowering (no control flow dependency)
- A tree encoding for lowering (every statement has exactly one user, except the root)
Key Features
UnifiedIR introduces first-class support for regions, enabling features like PR #58532 and better MLIR integration. It also supports dialect extensions natively. The PR ports inference, the optimizer, and JuliaLowering to the new structures, though bootstrap is not yet enabled. About half of the test suite passes with the new compiler version.
Bottom Line
This is a foundational change for Julia's compiler infrastructure. If merged, it will simplify compiler development, reduce ecosystem fragmentation, and open the door to better integration with MLIR-based tooling. The PR is still a work-in-progress and a basis for discussion, but it represents a serious attempt to modernize Julia's compiler internals after a decade of incremental growth.
Source: GitHub
Discussion
0 Comments
Be the first to start the discussion.