diff options
| author | 2026-03-16 18:15:37 +0100 | |
|---|---|---|
| committer | 2026-03-16 18:15:37 +0100 | |
| commit | 28261b6b1b55184ce7084eb14cdcb42edc7f8480 (patch) | |
| tree | 14843ed375949f42afce9501bff66c0ef398641d /ir/ir.c | |
| parent | 3e83c4280f0b1d72774c522a7e0d135913151b56 (diff) | |
regalloc: improve spilling and cleanup
Instead of spilling current interval when running out of registers,
spill the longest-lived active interval with a lower spill cost than
current. Spill costs are estimated based on multiplicative loop depth.
Also cleanup regalloc.c somewhat.
Update todo.txt too.
Diffstat (limited to 'ir/ir.c')
| -rw-r--r-- | ir/ir.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -479,7 +479,7 @@ insertphi(struct block *blk, enum irclass cls) return mkref(RTMP, new); } -void +uint numberinstrs(struct function *fn) { struct block *blk = fn->entry; @@ -488,6 +488,7 @@ numberinstrs(struct function *fn) blk->inumstart = start; start += blk->ins.n+2; } while ((blk = blk->lnext) != fn->entry); + return start-1; } static bool |