mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-09-26 21:36:06 -04:00
d30ccc9a72
check-all: 218 passed, 0 failed of 218 lever_census --check: 24,119 pin/asm sites, 24,119 marked !FAKE, 0 UNMARKED — OK Three moves, each predicted from a dump before it was compiled: - while -> a guarded do-while (29 to 22). Cross-jump (jump.c:1969 -> find_cross_jump :2371, from toplev.c:3142) had matched the load in front of the jump against the one in front of the bottom test and deleted three instructions; the guarded form makes the two tails differ. - the duplicated pre-loop call block -> goto (22 to 6). This is an allocno_compare rank move (global.c:585-611): the priority is floor_log2(refs)*refs/live, reg_n_refs is loop-weighted (flow.c:2067), the in-loop copy of that call is worth two references, and deleting the out-of-loop copy takes exactly one off — 8 to 7 crosses a floor_log2 step and drops the pointer's priority from 3157.9 to 1891.9. The predicted allocation order matched the dump exactly. The rewrite is byte-neutral on its own: reorg steals the target's first insn into the delay slot and retargets. - the two-arm mask temp inlined (6 to 0): set in two arms it has two deaths, fails local-alloc.c:472, and combine_regs bails at :1774, so it went to global allocation and took its copy preference. Harvested as R21 second_consumer, from agents b2 and b6 together: give a computed value a second consumer before its copy, either by chaining (v = slot = E) or by hoisting the store above it. cse deletes such a copy only when the producer sits immediately before it (cse.c:7440-7501, guard :7454-7460), and flow links only the FIRST following use (flow.c:2076-2091), so a store in between defeats both. R9 can never produce it — the two statements share the identifier, so its independence guard refuses the swap. Known-true: the joint form scores 0 on b6's pre-bank text, and the single-site forms do not, which is the third measured case this session of a joint edit no hill-climb can reach. Also recorded from b8, worth a pre-check later: declaration-order moves are PROVABLY DEAD on a register residual whose allocnos have distinct priorities, because global.c:604-610 compares priority first and only ties by allocno number — 4,811 compiles of those candidates sat flat because of it.