I stumbled upon Odin earlier this week and watched some of the videos.
Kudos on the great work so far.
You mention getting rid of LLVM and using a custom backend eventually, and just wanted to mention a backend called QBE (Quarrelsome Backend) that I stumbled upon not too long ago.
From the creator:
QBE aims to be a pure C embeddable backend that provides 70% of the performance of advanced compilers in 10% of the code. Its small size serves both its aspirations of correctness and our ability to understand, fix, and improve it. It also serves its users by providing trivial integration and great flexibility.
- Very good compatibility with C code.
- IEEE floating points support.
- SSA-based intermediate language.
- Copy elimination.
- Sparse conditional constant propagation.
- Dead instructions elimination.
- Registerization of small stack slots.
- Split spiller and register allocator thanks to SSA form. (Simpler and faster than graph coloring.)
- Smart spilling heuristic based on loop analysis.
- Linear register allocator with hinting.
- Recognizes and uses x64 addressing modes.
- Uniform and simple IL syntax.
I'm just learning about compiler construction so some of these bullets don't mean much to me right now, but maybe they do to you.
The website: https://c9x.me/compile/
And comparison of QBE with LLVM: https://c9x.me/compile/doc/llvm.html
Best of luck!