14 releases (6 breaking)
Uses new Rust 2024
| new 0.9.0-pre.6 | Dec 18, 2025 |
|---|---|
| 0.9.0-pre.3 | Nov 24, 2025 |
| 0.6.0 | Jul 18, 2025 |
| 0.4.0 | Jan 14, 2025 |
| 0.3.0 | Oct 28, 2024 |
#2548 in Algorithms
10,114 downloads per month
Used in 63 crates
(3 directly)
1.5MB
33K
SLoC
CubeCL Optimizer
A library that parses CubeCL IR into a control flow graph, transforms it to static single-assignment form and runs various optimizations on it. The order of operations is as follows:
- Parse root scope recursively into a control flow graph
- Run optimizations that must be done before SSA transformation
- Analyze variable liveness
- Transform the graph to pruned SSA form
- Run post-SSA optimizations and analyses in a loop until no more improvements are found
- Speed
The output is represented as a petgraph graph of BasicBlocks terminated by ControlFlow.
This can then be compiled into actual executable code by walking the graph and generating all
phi nodes, instructions and branches.
Representing PhiInstruction in non-SSA languages
Phi instructions can be simulated by generating a mutable variable for each phi, then assigning
value to it in each relevant block.
Compiler Optimizations
WIP
Dependencies
~14–22MB
~312K SLoC