2 ms·
Three IRs can actually help; it's not that simple. For example, https://blog.rust-lang.org/inside-rust/2019/12/02/const-prop-on-by-default.html https://blog.rus
by steveklabnik 6y ago
Three IRs can actually help; it's not that simple. For example, https://blog.rust-lang.org/inside-rust/2019/12/02/const-prop-on-by-default.html https://blog.rust-lang.org/inside-rust/2019/12/02/const-prop... is an example of performing an optimization on an earlier IR, which gives you a 2%-10% speed boost.
> Even though LLVM has its own constant propagation pass, we see improvements because our pass operates on MIR while it is still generic. The more concrete instances of a generic function that are instantiated, the larger the payoff from this optimization.
It can be counter-intuitive, but it just really depends on the details. Of course, a single pass compiler will be faster to compile than a more complicated one, but it's not as straightforward as "more IRs == slower."
- mhh__ 6y agoMy point was more along the lines of the language is sufficiently complex to lose the bigger picture when it comes to compile time speed rather than that the compiler is definitely slower due to said IRs.