new slot coalescing pass

This pass limits stack usage when
many small aggregates are allocated
on the stack. A fast liveness
analysis figures out which slots
interfere and the pass then fuses
slots that do not interfere. The
pass also kills stack slots that
are only ever assigned.

On the hare stdlib test suite, this
fusion pass managed to reduce the
total eligible slot bytes count
by 84%.

The slots considered for fusion
must not escape and not exceed
64 bytes in size.
This commit is contained in:
Quentin Carbonneaux 2022-11-20 22:14:41 +01:00
parent f5007126f3
commit 674901b718
3 changed files with 306 additions and 5 deletions

3
all.h
View file

@ -514,7 +514,8 @@ void fillloop(Fn *);
void simpljmp(Fn *);
/* mem.c */
void memopt(Fn *);
void promote(Fn *);
void coalesce(Fn *);
/* alias.c */
void fillalias(Fn *);