diff options
| author | 2023-06-13 12:02:28 +0200 | |
|---|---|---|
| committer | 2023-06-13 12:02:28 +0200 | |
| commit | de5aa052f234693698fa27564d12958df3fa433e (patch) | |
| tree | 837ed316bc13fe8063dde85e3b075c9357202297 /regalloc.c | |
| parent | 3e5c11563f8cb7c843c71a0f761e5b644f39db46 (diff) | |
use a hashtable for addr refs
Diffstat (limited to 'regalloc.c')
| -rw-r--r-- | regalloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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); |