commit 2a4fbbc6e0d3728aab7f1573f0c035f55aa33d77
parent 7202c7dedfcd274130cd15549e620a9b8513ef3f
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Wed, 22 Jul 2015 06:33:10 -0400
move some debug output out of main
Diffstat:
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/lisc/main.c b/lisc/main.c
@@ -2,7 +2,7 @@
char debug['Z'+1] = {
- ['S'] = 1, /* spiller */
+ ['S'] = 0, /* spiller */
};
void
@@ -11,7 +11,7 @@ dumpss(Bits *b, Sym *s, FILE *f)
int t;
fprintf(f, "[");
- for (t=Tmp0; t<BITS*NBit; t++)
+ for (t=0; t<BITS*NBit; t++)
if (BGET(*b, t))
fprintf(f, " %s", s[t].name);
fprintf(f, " ]\n");
@@ -75,21 +75,16 @@ main(int ac, char *av[])
break;
}
case 's': {
- int t;
Blk *b;
fprintf(stderr, "[Testing Spilling]\n");
+ debug['S'] = 1;
fillrpo(fn);
fillpreds(fn);
filllive(fn);
fillcost(fn);
- printf("> Spill costs:\n");
- for (t=Tmp0; t<fn->ntmp; t++)
- printf("\t%-10s %d\n",
- fn->sym[t].name,
- fn->sym[t].cost);
spill(fn);
- printf("\n> Block information:\n");
+ printf("> Block information:\n");
for (b=fn->start; b; b=b->link) {
printf("\t%-10s (% 5d) ",
b->name, b->loop);
diff --git a/lisc/spill.c b/lisc/spill.c
@@ -111,6 +111,14 @@ fillcost(Fn *fn)
}
symuse(b->jmp.arg, 1, n, fn);
}
+ if (debug['S']) {
+ fprintf(stderr, "> Spill costs:\n");
+ for (n=Tmp0; n<fn->ntmp; n++)
+ fprintf(stderr, "\t%-10s %d\n",
+ fn->sym[n].name,
+ fn->sym[n].cost);
+ fprintf(stderr, "\n");
+ }
}
int