mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-09-26 13:33:34 -04:00
5a39af246e
Byte-proven on ov_SC01_000/func_8017DD04 (297 ins). Pinning the 0x80 constant to $7 loses its sched1 birthing boost, because $a3 and $a2 are ALSO set by the function's own call-argument copies (reg_n_sets == 2) - a hard-register pin on an argument register is unavailable to any function that passes arguments in it. So win the ranking instead. local-alloc ranks by refs/live_length: 0x80 scored 13/319 = 4890 and took $6 (a pure $a2<->$a3 swap, 24 wrong). One six-input zero-byte asm on mlo at the blk3/blk4 boundary buys 6 references, 5217 > 4890, mlo takes $6 and 0x80 falls to $7 with its boost intact. The boundary must be the one cut no hoisted constant crosses, or you move the live lengths you are exploiting. Measured inert: pinning mlo to $6 (cse never substitutes a hard reg for a bitfield constant), and a dead hard-reg copy as a register suggestion (flow deletes it).