Missed optimization: computing smaller index than length does not elliminate bound check #80963
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
Code:
godbolt
Even replacing
usize::MAX/3
with any non-zero small number (even 1) does not result in removal of the bound check.This behavior can be reproduced on current Nightly and previous stable compiler versions.
The text was updated successfully, but these errors were encountered: