commit 134cfc45415bfaf95c68a70e3619b5bd220bde1b
parent a3650701d1f87100b6ab41cb120f7923eb851a33
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Thu, 4 Feb 2016 12:58:51 -0500
re-add ssa construction
Diffstat:
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/lisc/main.c b/lisc/main.c
@@ -55,8 +55,10 @@ func(Fn *fn)
filluse(fn);
#if 0
memopt(fn);
+#endif
ssa(fn);
filluse(fn);
+#if 0
copy(fn);
filluse(fn);
#endif
diff --git a/lisc/ssa.c b/lisc/ssa.c
@@ -171,8 +171,6 @@ fillrpo(Fn *f)
}
}
-#if 0
-
/* for dominators computation, read
* "A Simple, Fast Dominance Algorithm"
* by K. Cooper, T. Harvey, and K. Kennedy.
@@ -295,7 +293,7 @@ phiins(Fn *fn)
Ins *i;
Phi *p;
Ref r;
- int t, n, w, nt;
+ int t, n, k, nt;
blist = emalloc(fn->nblk * sizeof blist[0]);
be = &blist[fn->nblk];
@@ -305,7 +303,7 @@ phiins(Fn *fn)
if (fn->tmp[t].phi != 0)
continue;
BZERO(u);
- w = -1;
+ k = -1;
bp = be;
for (b=fn->start; b; b=b->link) {
b->visit = 0;
@@ -329,9 +327,9 @@ phiins(Fn *fn)
BSET(u, b->id);
*--bp = b;
}
- if (w == -1)
- w = i->wide;
- if (w != i->wide)
+ if (k == -1)
+ k = i->cls;
+ if (k != i->cls)
/* uh, oh, warn */
;
}
@@ -350,7 +348,7 @@ phiins(Fn *fn)
if (a->visit++ == 0)
if (BGET(a->in, t)) {
p = alloc(sizeof *p);
- p->wide = w;
+ p->cls = k;
p->to = TMP(t);
p->link = a->phi;
a->phi = p;
@@ -514,5 +512,3 @@ ssa(Fn *fn)
printfn(fn, stderr);
}
}
-
-#endif