https://github.com/Rexicon226/zob
Zig Optimizing Backend
https://github.com/Rexicon226/zob
Last synced: 7 days ago
JSON representation
Zig Optimizing Backend
- Host: GitHub
- URL: https://github.com/Rexicon226/zob
- Owner: Rexicon226
- Created: 2024-09-16T08:58:39.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-08T03:51:21.000Z (6 months ago)
- Last Synced: 2025-06-08T04:38:18.374Z (6 months ago)
- Language: Zig
- Size: 491 KB
- Stars: 20
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-egraphs - Zob
README
### Zig Optimizing Backend
This is sort of two projects in one. The first goal is to develop a prototype optimizing backend
for the Zig compiler, testing out different IRs and representations, to find the one that will
suite Zig the best. A second goal is to create a general optimizing backend, one that can be used
as for simple compiled languages, test out new and interesting optimizations, and just see how Zig
fairs as a language, for writing optimizers.
The current implementation is a mix of E-Graphs and Sea of Nodes. At first, I was keen on using RVSDG
since given Zig's very structural nature it seemed like it would be a good fit, however after a few
months of fiddling around with it, RVSDG is just too restrictive. This is likely just my own experience,
but I found it extremely difficult to develop algorithms to convert from Zig's SSA to RVSDG.
Maybe I'll come back to it one day, but for now, I'd like to use something a bit less esoteric, such as
SoN, and move further in the implementation.
Implementation goals are:
- Implement an abstract optimizing IR based on e-graphs, rvsdg, and SoN.
- Implement a RISC-V machine code backend to provide a simpler method
of register allocation and backend generalization.