diff options
| author | Scott Gasch <[email protected]> | 2026-09-18 23:43:06 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-09-18 23:43:06 -0700 |
| commit | c5bd92a091de05af03c4c5d4842e5f8a54abefa5 (patch) | |
| tree | 60033289088c8bb1c0c1b88db30d7b4f32b35b64 /src/save/root.c | |
| parent | 91dc4a9393204104c06fa64a05be24d08feca0ef (diff) | |
Add -flto and -mtune=native to the release build
-flto: several functions (_RookAttacksBB/_BishopAttacksBB in
generate.c, and others from recent sessions) are declared FORCEINLINE
but non-static, exposed specifically so other translation units can
call them -- __attribute__((always_inline)) only actually forces
inlining within the TU that has the function body, so every cross-file
call was paying for a real call/ret instead of inlining without this.
Measured via the `bench` command (4 reps each, interleaved with a
non-LTO baseline): a clean, reproducible ~6.6% NPS improvement with
zero overlap between the two distributions (baseline 1643k-1661k nps,
LTO 1752k-1768k nps) -- not noise.
-mtune=native: tunes instruction scheduling/costs for the actual build
machine instead of a generic x86-64 target. Measured weaker and
noisier (~1.5%, some overlap with baseline) but real and free -- no
portability cost the way -march=native's newer-ISA-extension
dependency would carry.
precommit_check.sh (self-tests + DEBUG smoke test) passed clean with
both flags active.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/save/root.c')
0 files changed, 0 insertions, 0 deletions
