Commit 0658567
committed
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 #115271File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments