Hello.
I'm using cranelift as a compiler backend for my project. I need very fast compile times. Using cranelift 0.113, it shows that there are lots of room for improvement. Notably verification and functions/methods in cranelift_codegen::ir::dfg consume a lot. Tips to further improve these areas are very welcome. BTW, what does verification mean? I didn't find anything in the docs of verify_function.
Thanks in advance.
The IR verifier checks that the input clif ir follows all the rules of clif ir. You can disable the enable_verifier option to disable it. For example: https://github.com/rust-lang/rustc_codegen_cranelift/blob/30c48bcb55e10518e4e59a78dcab439a0b327725/src/lib.rs#L298
The IR verifier is known to be somewhat slow. I would recommend enabling it during development, but disabling it for release builds.
If something is rejected by the IR verifier, disabling the IR verifier often causes a panic later on during compilation.
Alright thanks. Since I'm using 0.113 and the latest is 0.120, would upgrading to latest have advantages for me? I can't easily find changelogs about cranelift in the repo.
Last updated: Dec 06 2025 at 07:03 UTC