MaskRay presents direct LLVM -O0 IR code generator

maskray.me17 min read

This article describes an experimental direct code generator for LLVM that compiles functions from LLVM IR directly to machine code bytes without building a MachineFunction, falling back to the regular pipeline when necessary. Measured on the LLVM compile-time tracker, the approach reduces build instructions by 14 percent on x86-64 and 21 percent on AArch64 for -O0 -g builds. The author details the implementation challenges, target-specific handling for x86-64 and AArch64, debug information generation, and remaining performance and code size trade-offs. Open article →