Open leonardo-m opened 8 years ago
Awesome idea! I'm not really fluent in asm, let alone fluent enough to know which instruction takes how much time, but I still want to improve performance, and this would make it easier for me.
Definitely useful but I'm unsure how hard this would be. Most (if not all) of the elimination are done by the llvm optimizer.
Triage; not aware of any changes
Perhaps the index_slicing clippy lint partially covers this?
This is my first Rust enhancement request.
With the Go language compiler version 1.7, you can build the code using -gcflags="-d=ssa/check_bce/debug=1" to show which code lines still need checking bounds:
http://www.tapirgames.com/blog/golang-1.7-bce
Finding where the compiler is not able to optimize away run-time bound checks is important for some kinds of code where performance matters:
https://github.com/rust-lang/rust/pull/30917
Currently to do that in Rust I have to generate the asm with --emit asm, search the function(s) (this sometimes is not so easy because of inlining) and then read the asm to understand if and where it performs bound checks. This is a bit laborious and not handy. So is it possible to add to Rustc a compilation switch similar to Go that outputs all the lines and column where LLVM isn't able to remove array bound tests?
(Having this compiler switch is only about one third of this performance battle).