aboutsummaryrefslogtreecommitdiffhomepage
path: root/regalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'regalloc.c')
-rw-r--r--regalloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/regalloc.c b/regalloc.c
index 68d6592..683e591 100644
--- a/regalloc.c
+++ b/regalloc.c
@@ -528,7 +528,9 @@ priliveset(struct bitset *s, size_t siz)
static void
usereg(struct rega *ra, int reg, struct block *blk, int pos)
{
- struct fixinterval *fxit = alloc(ra->arena, sizeof *fxit, 0);
+ struct fixinterval *fxit;
+ if (rstest(mctarg->rglob, reg)) return; /* regalloc never allocates globally live regs, so don't need intervals for those */
+ fxit = alloc(ra->arena, sizeof *fxit, 0);
fxit->next = ra->intervals.fixed;
fxit->range = (struct range) {blk->inumstart, pos};
fxit->rs = 1<<reg;
@@ -537,6 +539,7 @@ usereg(struct rega *ra, int reg, struct block *blk, int pos)
static void
defreg(struct rega *ra, int reg, int pos) {
+ if (rstest(mctarg->rglob, reg)) return;
for (struct fixinterval *fxit = ra->intervals.fixed; fxit; fxit = fxit->next) {
if (fxit->rs == 1<<reg) {
assert(fxit->range.from <= pos);