High Priority bugs in LLVM for the Rust compiler indicates that we need to ask Huawei's help to resolve these problems.
At the following thread a heated discussion has revealed 5-10 issues that need to be addressed.
A lot of these have examples on godbolt. Add --emit llvm-ir
to the flags to
show the LLVM IR that rustc is generating.
Unnecessary auto-vectorization ie emitted when the max length of a loop is always less than 16.
https://bugs.llvm.org/show_bug.cgi?id=40027
https://bugs.llvm.org/show_bug.cgi?id=51211
https://rust.godbolt.org/z/hfG734fGf
https://godbolt.org/z/d5PKx3b1d
https://godbolt.org/z/x95rGbW4j
https://godbolt.org/z/ehxabaq38
This comment shows a simple example of this issue:
rust-lang/rust#88616 (comment)
Specifically the example in this comment is not being optimized.
rust-lang/rust#51346 (comment)
See the godbolt examples here:
https://godbolt.org/z/fPjn9zxo6
The example LLVM IR that fails to optimize is in this comment: