diff options
author | Teddy <[email protected]> | 2014-05-18 11:36:07 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2014-05-18 11:36:07 +0800 |
commit | 73559820d75f3b766c9db2489f7f8cad224d257f (patch) | |
tree | c8f1beb4474050487affb97525d086d9a529839a | |
parent | d84e0dac79287b481a833cce3353c0d59fa7b9a1 (diff) |
...
-rw-r--r-- | ssa.c | 10 | ||||
-rw-r--r-- | ssa.h | 2 |
2 files changed, 8 insertions, 4 deletions
@@ -339,6 +339,8 @@ void ssa_generate(int quiet) { cf->defs = defs; cf->entry = entry; cf->next = func_ir; + memmove(cf->blks, blks); + memmove(cf->ord, ord); func_ir = cf; gbbase += bcnt; bcnt = 0; @@ -2145,7 +2147,7 @@ void const_propagation(void) { int i; for (i = bcnt - 1; i >= 0; i--) { - CBlock_t b = blks[vis[i]]; + CBlock_t b = blks[ord[i]]; CInst_t i, ni, ih = b->insts; for (i = ih->next; i != ih; i = ni) { @@ -2282,7 +2284,7 @@ void strength_reduction(void) { int call_cnt = 0; for (i = bcnt - 1; i >= 0; i--) { - CBlock_t b = blks[vis[i]]; + CBlock_t b = blks[ord[i]]; CInst_t i, ni, ih = b->insts; for (i = ih->next; i != ih; i = ni) { @@ -2615,7 +2617,7 @@ void deadcode_elimination() { int i; for (i = bcnt - 1; i >= 0; i--) { - CBlock_t b = blks[vis[i]]; + CBlock_t b = blks[ord[i]]; CInst_t i, ih = b->insts; for (i = ih->next; i != ih; i = i->next) { @@ -2626,7 +2628,7 @@ void deadcode_elimination() { } for (i = bcnt - 1; i >= 0; i--) { - CBlock_t b = blks[vis[i]]; + CBlock_t b = blks[ord[i]]; CInst_t i, ih = b->insts; for (i = ih->next; i != ih; i = i->next) if (i->op != CALL && i->dest && i->dest->kind == TMP && !i->dest->dep) @@ -149,6 +149,8 @@ typedef struct CFuncIR CFuncIR; typedef CFuncIR *CFuncIR_t; struct CFuncIR { int gbbase; + CBlock_t blks[MAX_BLOCK]; + int ord[MAX_BLOCK]; CBlock_t entry; COList_t defs; CType_t func; |