3 ms·
I learned quite recently that one of the limiting factors in the Rust compiler’s performance is the LLVM IR it produces being of poor quality. This means that L
by moomin 4y ago
I learned quite recently that one of the limiting factors in the Rust compiler’s performance is the LLVM IR it produces being of poor quality. This means that LLVM itself takes much longer to produce code. Are there any initiatives to address this?
- emi2k01 4y agoYes, I guess?: Cranelift, which is a LLVM-like library written in Rust. This could be used for faster debug builds in the future. There's a Rust backend using Cranelift [2]. If you mean addressing the poor quality of LLVM IR directly, then I don't know. [1]: https://github.com/bytecodealliance/wasmtime/blob/main/cranelift/README.md https://github.com/bytecodealliance/wasmtime/blob/main/crane... [2]: https://github.com/bjorn3/rustc_codegen_cranelift https://github.com/bjorn3/rustc_codegen_cranelift
- spoiler 4y agoI thought (maybe incorrectly) that most of the time is spent on linking in Rust codebase. Aside: out of curiosity, how did you find out about this fact/quirk about LLVM IR?
- PoignardAzur 4y agoIt's unclear. There were discussions on the rustc Zulip that recently pointed to LLVM being actually quite performant at canonicalizing poor-quality IR; so any time saved in the backend by producing better IR is offset by the additional time spent in the front-end to produce that IR. (I'm not a compiler developer, don't quote me on this)