3 ms·
Rust is famous for throwing garbage IR at LLVM and hoping it cleans it all up. They've made a lot of progress but comparing the timing is very misleading when t
by tick_tock_tick 7y ago
Rust is famous for throwing garbage IR at LLVM and hoping it cleans it all up. They've made a lot of progress but comparing the timing is very misleading when the work is intentionally offloaded to LLVM.
- int_19h 7y agoIsn't that kind of the point of having a relatively high-level backend - to avoid the need for every front-end to do the same tedious optimizations?
- nitwit005 7y agoYou do have to have some sort of balance. With a large enough input, any program will become slow.
- dtolnay 7y agoMy comment is in response to "super cool idea, but I don't think it's going to help Rust compile speeds". Even a compiler that emits garbage IR from the frontend would get 20x faster with a magic instant backend if 95% of time is currently spent in the backend. A magic instant backend is unrealistic, so Rust will need to move some of the current backend work to frontend work for things that can be done more efficiently on the frontend. But the fact remains that there is an opportunity for big improvement from a much faster backend.
- nerdponx 7y agoIt sounds like this is addressed in the post, no? LLVM IR doesn't always map cleanly to Rust representations, so a backend that supports a cleaner mapping should obviate the need for more frontend optimization. I'm basically a layperson when it comes to this topic, but that's my understanding of one of the potential benefits of a different backend.