about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-07-18 10:16:58 +0000
committerbors <bors@rust-lang.org>2022-07-18 10:16:58 +0000
commit9ed0bf9f2bd63933785fb8a380c177d2d70e88ec (patch)
treebfb57073698c842ec8dcf94a021e2b3c77f59afd /compiler/rustc_codegen_gcc
parent880416180b0a9ee1141c07d4d17667edb77daebd (diff)
parentc9373903e759c96f2ab8ba2a78c6799b5d92b105 (diff)
downloadrust-9ed0bf9f2bd63933785fb8a380c177d2d70e88ec.tar.gz
rust-9ed0bf9f2bd63933785fb8a380c177d2d70e88ec.zip
Auto merge of #99223 - saethlin:panicless-split-mut, r=Mark-Simulacrum
Rearrange slice::split_mut to remove bounds check

Closes https://github.com/rust-lang/rust/issues/86313

Turns out that all we need to do here is reorder the bounds checks to convince LLVM that all the bounds checks can be removed. It seems like LLVM just fails to propagate the original length information past the first bounds check and into the second one. With this implementation it doesn't need to, each check can be proven inbounds based on the one immediately previous.

I've gradually convinced myself that this implementation is unambiguously better based on the above logic, but maybe this is still deserving of a codegen test?

Also the mentioned borrowck limitation no longer seems to exist.
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions