Got around to do some programming on my C (plus) compiler again, so I implemented an x64 backend. Instead of feeding LLVM some IR and letting it generate an .obj, the compiler now first generates its own SSA IR which is very much like LLVM's, which then gets converted to unoptimized x64 machinecode. It also generates debug info (globals, functions, locals, types and line info), so it is now almost functionally equivalent to the LLVM backend. LLVM took about 500ms to just generate an .obj without optimizations, the x64 backend takes more like 25ms (though the resulting code is much slower).

It's very fun for the first time stepping through your program which your compiler compiled all by itself and looking at all the variables 🙂 And to see that even absolutely terrible machinecode is still fast enough for a lot of things on a modern computer...