about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-02 08:20:35 +0000
committerbors <bors@rust-lang.org>2024-08-02 08:20:35 +0000
commit19326022d243f487b5752661cd9b597d620a489e (patch)
treea58740084dc58d8e011b491ca97d64317511575c /compiler/rustc_codegen_llvm/src
parent2cec7a85ed4868c90194a2187d2751788e298197 (diff)
parentbb584882070f2f45b35f0af172069e7c00d63983 (diff)
downloadrust-19326022d243f487b5752661cd9b597d620a489e.tar.gz
rust-19326022d243f487b5752661cd9b597d620a489e.zip
Auto merge of #128254 - Amanieu:orig-binary-search, r=tgross35
Rewrite binary search implementation

This PR builds on top of #128250, which should be merged first.

This restores the original binary search implementation from #45333 which has the nice property of having a loop count that only depends on the size of the slice. This, along with explicit conditional moves from #128250, means that the entire binary search loop can be perfectly predicted by the branch predictor.

Additionally, LLVM is able to unroll the loop when the slice length is known at compile-time. This results in a very compact code sequence of 3-4 instructions per binary search step and zero branches.

Fixes #53823
Fixes #115271
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions