Files
BFM-decomp/docs/gcc-2.7.2-map
Drew T 3371e57ed0 docs(phase-29): regalloc.md §H — the swap oracle's two unstated PRECONDITIONS
§H sold the reg_renumber-swap oracle as THE one-gdb-run discriminator between RC-6 (allocation) and
S3 (scheduling). It has two preconditions it never stated, and both failed silently on the first
real use after the audit:

1. reg_renumber maps PSEUDOS ONLY (index >= FIRST_PSEUDO_REGISTER = 68 on MIPS, mips.h:1179). A
   contested register that is already HARD at .greg time — an incoming parameter reg, a pin, or a
   local-alloc reuse — is structurally unreachable. Check the .greg RTL first: (reg/v:SI 6 a2) with
   6 < 68 does not qualify; only (reg:SI 130)-style operands do.
2. The contest must be NARROW. The swap is global across reg_renumber, so if the pair serves many
   pseudos it destroys the allocations that were already correct.

Byte-measured on func_80176734, baseline 13: control 1<->1 -> 13 (harness validated);
<-> moved 17 pseudos -> 345; <-> moved 31 -> 97. The .greg read then showed the
destination was (reg/v:SI 6 a2) — hard, a reused incoming parameter register — so the true class was
local-alloc TYING (K8/RC-4), not RC-6, and the lever is C-level lifetime shaping.

Harness + negative control preserved at tools/oracle/reg_renumber_swap.sh.
2026-07-28 15:02:51 -06:00
..