aboutsummaryrefslogtreecommitdiffhomepage
path: root/regalloc.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-06-13 12:02:28 +0200
committerlemon <lsof@mailbox.org>2023-06-13 12:02:28 +0200
commitde5aa052f234693698fa27564d12958df3fa433e (patch)
tree837ed316bc13fe8063dde85e3b075c9357202297 /regalloc.c
parent3e5c11563f8cb7c843c71a0f761e5b644f39db46 (diff)
use a hashtable for addr refs
Diffstat (limited to 'regalloc.c')
-rw-r--r--regalloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/regalloc.c b/regalloc.c
index bf7bac6..b90940f 100644
--- a/regalloc.c
+++ b/regalloc.c
@@ -130,9 +130,10 @@ use(struct rega *ra, struct block *blk, int curi, enum op op, int hint, union re
int excl = other.t == RREG ? other.i : -1;
if (ref->t == RMORE) {
- struct addr *addr = &addrtab.p[ref->i];
- if (addr->base.t) use(ra, blk, curi, 0, hint, &addr->base, addr->index);
- if (addr->index.t) use(ra, blk, curi, 0, hint, &addr->index, NOREF);
+ struct addr addr = addrht[ref->i];
+ if (addr.base.t) use(ra, blk, curi, 0, hint, &addr.base, addr.index);
+ if (addr.index.t) use(ra, blk, curi, 0, hint, &addr.index, NOREF);
+ *ref = mkaddr(addr);
return;
} else if (ref->t == RREG) {
forcetake(ra, ref->i, *ref, blk, curi);