From 28261b6b1b55184ce7084eb14cdcb42edc7f8480 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 16 Mar 2026 18:15:37 +0100 Subject: 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. --- ir/ir.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ir/ir.h') diff --git a/ir/ir.h b/ir/ir.h index e7eb62a..ab3e474 100644 --- a/ir/ir.h +++ b/ir/ir.h @@ -295,7 +295,7 @@ void fillblkids(struct function *); #define startbbvisit() (void)(++visitmark) #define wasvisited(blk) ((blk)->visit == visitmark) #define markvisited(blk) ((blk)->visit = visitmark) -void numberinstrs(struct function *); +uint numberinstrs(struct function *); bool blkreachable(struct function *fn, struct block *blk); /** builder.c **/ -- cgit v1.2.3