commit 215914f58d363b6622b37079fb22073415cfb4b8
parent 56fc8bfe5cc882683ffc9a87a01591c7fdc72e71
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Wed, 23 Dec 2015 17:05:41 -0500
missing case in tmpuse() of spiller
Diffstat:
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/lisc/spill.c b/lisc/spill.c
@@ -31,14 +31,20 @@ loopmark(Blk *hd, Blk *b, Phi *p)
static void
tmpuse(Ref r, int use, int loop, Fn *fn)
{
+ Mem *m;
Tmp *t;
- if (rtype(r) != RTmp || r.val < Tmp0)
- return;
- t = &fn->tmp[r.val];
- t->nuse += use;
- t->ndef += !use;
- t->cost += loop;
+ if (rtype(r) == RAMem) {
+ m = &fn->mem[r.val & AMask];
+ tmpuse(m->base, 1, loop, fn);
+ tmpuse(m->index, 1, loop, fn);
+ }
+ else if (rtype(r) == RTmp && r.val >= Tmp0) {
+ t = &fn->tmp[r.val];
+ t->nuse += use;
+ t->ndef += !use;
+ t->cost += loop;
+ }
}
/* evaluate spill costs of temporaries,