qbe

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

commit 65c35372fd282d8176686834026f748763e613df
parent 32ad5e368a127fb0ca2c77c76d2245455db04e55
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Sun, 25 Oct 2015 21:28:31 -0400

setup hints for function arguments

Diffstat:
Mlisc/rega.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/lisc/rega.c b/lisc/rega.c @@ -363,6 +363,7 @@ rega(Fn *fn) int n, t, r, x; Blk *b, *b1, *s, ***ps, *blist; RMap *end, *beg, cur; + Ins *i; Phi *p; uint u; Ref src, dst; @@ -375,6 +376,13 @@ rega(Fn *fn) beg = alloc(fn->nblk * sizeof beg[0]); for (t=Tmp0; t<fn->ntmp; t++) tmp[t].hint = -1; + for (b=fn->start, i=b->ins; i-b->ins < b->nins; i++) + if (i->op != OCopy || !isreg(i->arg[0])) + break; + else { + assert(rtype(i->to) == RTmp); + *hint(i->to.val) = i->arg[0].val; + } /* 2. assign registers following post-order */ for (n=fn->nblk-1; n>=0; n--) {