mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-04 08:21:50 -04:00
1010 B
1010 B
§393 ★★ — THE BIRTHING BOOST: A SINGLE-SET LOCAL IS SCHEDULED LAST; GIVE IT A SECOND SET (P31 S69; byte-proven ov_SC02_017/func_8017FCFC)
A pointer local assigned exactly once (p = D_8018E204;) receives gcc-2.7.2's maximum scheduling
priority, and because sched2 works BACKWARD that pushes it LATE — emitting lui/addiu $s1 after the
jal where the target has it before. Five instructions of residual, invariant under statement order.
The lever: a zero-byte re-tie in a later block gives the pseudo a SECOND set and kills the boost:
__asm__("" : "=r"(p) : "0"(p)); /* non-volatile, zero bytes, p is now 2-set */
This is the scheduler-side sibling of §380 (a second set disqualifies a pseudo from
move_movables). Same one-line trick, two different passes, opposite symptoms: §380 un-hoists a loop
invariant, §393 un-delays a preheader constant. If a single-assignment local lands on the wrong side
of a call, try the re-tie before reaching for a register pin.