aboutsummaryrefslogtreecommitdiffhomepage
path: root/optmem.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-09-16 17:24:52 +0200
committerlemon <lsof@mailbox.org>2025-09-16 17:24:52 +0200
commit75db572e8a7a144b3d6fdc2b148ac3921f77f2b2 (patch)
tree092f3417cbdad29397d5eeeef3e0645febddb096 /optmem.c
parent0368070045f0ebcdcb12d49da9edc4d10ca30c60 (diff)
implement switch statement
Diffstat (limited to 'optmem.c')
-rw-r--r--optmem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/optmem.c b/optmem.c
index 9e8d1c6..1c137b7 100644
--- a/optmem.c
+++ b/optmem.c
@@ -184,8 +184,8 @@ void
mem2reg(struct function *fn)
{
static struct bitset ssealed[4];
- struct block *blk = fn->entry;
struct ssabuilder sb = { .nblk = fn->nblk };
+ struct block *blk;
sb.pendingphis = xcalloc(fn->nblk * sizeof *sb.pendingphis);
if (fn->nblk <= 64 * arraylength(ssealed)) {
@@ -195,6 +195,9 @@ mem2reg(struct function *fn)
sb.sealed = xcalloc(BSSIZE(fn->nblk) * sizeof *sb.sealed);
}
+ sortrpo(fn);
+ blk = fn->entry;
+
do {
for (int i = 0; i < blk->ins.n; ++i) {
struct use *use, *uend;