diff options
| author | 2025-09-17 09:49:22 +0200 | |
|---|---|---|
| committer | 2025-09-17 09:49:22 +0200 | |
| commit | 960f79fa50009fd1e95a294547e3e46494d49484 (patch) | |
| tree | 93fbb3bb326f7efb8cfdfb249f0d1b76ef25d3bc /regalloc.c | |
| parent | 3d0c49f4eb9e13e00bf12940b53da0f018c0a58c (diff) | |
alloc changes
Diffstat (limited to 'regalloc.c')
| -rw-r--r-- | regalloc.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -780,20 +780,17 @@ linearscan(struct rega *ra) struct interval **unhandled = NULL; struct interval *active = NULL, *inactive = NULL, *handled = NULL; + if (!intervals->count) return; /* sort intervals */ { extern int ninstr; - unhandled = xcalloc(sizeof *unhandled * intervals->count); + unhandled = alloc(ra->arena, sizeof *unhandled * intervals->count, 0); for (int i = 0; i < ninstr; ++i) { if (!intervals->temps[i].nrange) continue; unhandled[nunhandled++] = &intervals->temps[i]; } assert(nunhandled == intervals->count); - if (!nunhandled) { - free(unhandled); - return; - } sortintervals(unhandled, 0, nunhandled-1); } @@ -954,8 +951,6 @@ linearscan(struct rega *ra) active = current; } } - - free(unhandled); } /* replace temps with physical regs, add loads & stores for spilled temps */ |