qbe

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

commit 630127c68b872dcb7ddb22079f91f001b73945fc
parent e092473be1cf48216085f8349677cefc8f19b3b2
Author: Michael Forney <mforney@mforney.org>
Date:   Sat, 12 Feb 2022 02:27:46 -0800

spill: consider jump argument as use of register

Diffstat:
Mspill.c | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/spill.c b/spill.c @@ -412,6 +412,20 @@ spill(Fn *fn) bscopy(b->out, v); /* 2. process the block instructions */ + if (rtype(b->jmp.arg) == RTmp) { + t = b->jmp.arg.val; + assert(KBASE(tmp[t].cls) == 0); + lvarg[0] = bshas(v, t); + bsset(v, t); + bscopy(u, v); + limit2(v, 0, 0, NULL); + if (!bshas(v, t)) { + if (!lvarg[0]) + bsclr(u, t); + b->jmp.arg = slot(t); + } + reloads(u, v); + } curi = &insb[NIns]; for (i=&b->ins[b->nins]; i!=b->ins;) { i--;