diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-02-04 12:58:51 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-02-04 12:58:51 -0500 |
commit | 134cfc45415bfaf95c68a70e3619b5bd220bde1b (patch) | |
tree | 38de80da6d19a2afcd585b960ba90bfffd189db3 | |
parent | a3650701d1f87100b6ab41cb120f7923eb851a33 (diff) | |
download | roux-134cfc45415bfaf95c68a70e3619b5bd220bde1b.tar.gz |
re-add ssa construction
-rw-r--r-- | lisc/main.c | 2 | ||||
-rw-r--r-- | lisc/ssa.c | 16 |
2 files changed, 8 insertions, 10 deletions
diff --git a/lisc/main.c b/lisc/main.c index 10de4d6..6e27e3e 100644 --- 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 index 7353dc3..9b584a7 100644 --- 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 |