qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 04e26409011389f7b5759114905195a4fb0b0286
parent 87dc3ea290a4ba75f153c5bb8b9fb87ec548e64f
Author: Quentin Carbonneaux <quentin@c9x.me>
Date:   Tue, 22 Nov 2022 16:52:42 +0100

rename Tmp.ins to be more descriptive

Diffstat:
Mall.h | 2+-
Mmem.c | 10+++++-----
Mssa.c | 4++--
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/all.h b/all.h @@ -297,7 +297,7 @@ struct Alias { struct Tmp { char name[NString]; - Ins *ins; + Ins *def; Use *use; uint ndef, nuse; uint bid; /* id of a defining block */ diff --git a/mem.c b/mem.c @@ -299,8 +299,8 @@ coalesce(Fn *fn) } while (n--) { t = &fn->tmp[kill[n]]; - assert(t->ndef == 1 && t->ins); - *t->ins = (Ins){.op = Onop}; + assert(t->ndef == 1 && t->def); + *t->def = (Ins){.op = Onop}; for (u=t->use; u<&t->use[t->nuse]; u++) { assert(u->type == UIns); i = u->u.ins; @@ -327,7 +327,7 @@ coalesce(Fn *fn) if (s->s || !s->r.b) goto Skip; if (rovlap(r, s->r)) - /* O(n^2) can be approximated + /* O(n) can be approximated * by 'goto Skip;' if need be */ for (m=n; &sl[m]<s; m++) @@ -347,8 +347,8 @@ coalesce(Fn *fn) if (s->s == s) continue; t = &fn->tmp[s->t]; - assert(t->ndef == 1 && t->ins); - *t->ins = (Ins){.op = Onop}; + assert(t->ndef == 1 && t->def); + *t->def = (Ins){.op = Onop}; for (u=t->use; u<&t->use[t->nuse]; u++) { assert(u->type == UIns); arg = u->u.ins->arg; diff --git a/ssa.c b/ssa.c @@ -47,7 +47,7 @@ filluse(Fn *fn) /* todo, is this the correct file? */ tmp = fn->tmp; for (t=Tmp0; t<fn->ntmp; t++) { - tmp[t].ins = 0; + tmp[t].def = 0; tmp[t].bid = -1u; tmp[t].ndef = 0; tmp[t].nuse = 0; @@ -89,7 +89,7 @@ filluse(Fn *fn) w = WFull; t = i->to.val; tmp[t].width = w; - tmp[t].ins = i; + tmp[t].def = i; tmp[t].bid = b->id; tmp[t].ndef++; tmp[t].cls = i->cls;