[libc-commits] [libc] [libc][stdlib] Optimize bsearch() by reordering comparison branches (PR #230823)

Kuan-Wei Chiu via libc-commits libc-commits at lists.llvm.org
Sat Oct 10 11:22:59 PDT 2026


visitorckw wrote:

This idea came up during a previous glibc bsearch() optimization patchset [1] review where DJ Delorie suggested [2] checking < 0 and > 0 before == 0.

Link: https://inbox.sourceware.org/libc-alpha/20240909162327.3163100-1-visitorckw@gmail.com/ [1]
Link: https://inbox.sourceware.org/libc-alpha/xnh6aldef3.fsf@greed.delorie.com/ [2]

https://github.com/llvm/llvm-project/pull/230823


More information about the libc-commits mailing list