[all-commits] [llvm/llvm-project] 06f971: [libcxx] Use a table for the offsets in __next_pri...
PiJoules via All-commits
all-commits at lists.llvm.org
Thu Feb 12 10:57:55 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 06f97167626218cfa38e430098c83e4c58a909ae
https://github.com/llvm/llvm-project/commit/06f97167626218cfa38e430098c83e4c58a909ae
Author: PiJoules <6019989+PiJoules at users.noreply.github.com>
Date: 2026-02-12 (Thu, 12 Feb 2026)
Changed paths:
M libcxx/src/hash.cpp
Log Message:
-----------
[libcxx] Use a table for the offsets in __next_prime (#180651)
This reduces the size of __next_prime on armv8m baremetal from 1.4KB to
about 276B. Ideally there would be something that rolls up the if chain
into a single loop but there doesn't seem to be anything that does that
in llvm. Conversely, we should expect an unroller to be able to unroll
this loop in something like a -O3 build, but we unfortunately don't see
that either. I suspect perf might not be as much of a concern here since
this function is already called in a slow path when rehashing might be
done.
---------
Co-authored-by: Nikolas Klauser <nikolasklauser at berlin.de>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list