Missing optimization with signed pointer offset #56057
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I am trying to elide the pointer offset of a slice indexing operation.
I tried this code:
with
RUST_BACKTRACE=full RUSTFLAGS='--emit=asm' cargo build --release
.I expected to see this happen:
(selects two bits, already in the pointer offset position)
Instead, this happened:
A godbolt link for comparison with an unsafe version which does apply the optimization: https://godbolt.org/z/0QsA3z
Meta
Backtrace:
none
The text was updated successfully, but these errors were encountered: