|
|
|
|
|
by ckok
2339 days ago
|
|
I'm trying to write a drop in LLVM codegen replacement, ie something that takes bitcode (Which I already have) and generates x86_64, arm, object files etc. Back story: I've done compilers for most of my professional life but never did the actual native code generation myself, always using .net, java or llvm to do that part. As a fun project, as I already had code to generate llvm bitcode from .NET, I now do mem2reg (convert stack spots to SSA registers), dead code elimination, constant folding and other small optimizations. That part now works, and I managed to create a simple x86_64 coff object file (with everything needed to link to it, including pdata, xdata) that returns the "max" value for a given integer. That is about all that works for now, and I don't get to spend much time on it, but the end goal is to have a "good enough" codegenerator for non optimized cases, that could potentially be faster than llvm (to emit). The primary goal is to learn how to do this though :) |
|