diff options
| author | Quentin Carbonneaux <[email protected]> | 2026-01-05 08:55:17 +0100 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2026-01-13 17:09:41 +0100 |
| commit | 6a2dca8b9986bd51be1617c68f1039db5d198243 (patch) | |
| tree | a7177cae459830fc43085efcb4b9f921ea9e1f48 | |
| parent | e0ded59639848a82878bbcf0b27fb3637f8d9353 (diff) | |
fix jmp arg spilling
In case we need to spill to accomodate
for the jump argument, piggyback the
reloads from slots to regalloc so that
they can be correctly inserted on edges.
| -rw-r--r-- | spill.c | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -406,26 +406,20 @@ spill(Fn *fn) if (rtype(b->jmp.arg) == RCall) v->t[0] |= T.retregs(b->jmp.arg, 0); } - for (t=Tmp0; bsiter(b->out, &t); t++) - if (!bshas(v, t)) - slot(t); - bscopy(b->out, v); - - /* 2. process the block instructions */ if (rtype(b->jmp.arg) == RTmp) { t = b->jmp.arg.val; assert(KBASE(tmp[t].cls) == 0); - lvarg[0] = bshas(v, t); bsset(v, t); - bscopy(u, v); limit2(v, 0, 0, NULL); - if (!bshas(v, t)) { - if (!lvarg[0]) - bsclr(u, t); + if (!bshas(v, t)) b->jmp.arg = slot(t); - } - reloads(u, v); } + for (t=Tmp0; bsiter(b->out, &t); t++) + if (!bshas(v, t)) + slot(t); + bscopy(b->out, v); + + /* 2. process the block instructions */ curi = &insb[NIns]; for (i=&b->ins[b->nins]; i!=b->ins;) { i--; |
