X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCdflow.c;h=a45eb174b19f702ddf294e622eb0dd5153a6113b;hb=eae1bd2f705a2c61e143c539f8c4d1e9c2b4efe6;hp=a4cee93d8045a0cbe12848067cc4880da8218ebf;hpb=4ce4ccfc2eb165c16b1636756493120423a7c170;p=fw%2Fsdcc diff --git a/src/SDCCdflow.c b/src/SDCCdflow.c index a4cee93d..a45eb174 100644 --- a/src/SDCCdflow.c +++ b/src/SDCCdflow.c @@ -123,6 +123,9 @@ DEFSETFUNC (mergeInExprs) } else { + //if (dest != ebp) + // dest->inExprs = intersectSets (dest->inExprs, ebp->outExprs, THROW_DEST); + /* delete only if killed in this block*/ deleteItemIf (&dest->inExprs, ifKilledInBlock, ebp); /* union the ndompset with pointers set in this block */ @@ -162,8 +165,10 @@ DEFSETFUNC (mergeInDefs) /* computeDataFlow - does computations for data flow accross blocks */ /*-----------------------------------------------------------------*/ void -computeDataFlow (eBBlock ** ebbs, int count) +computeDataFlow (ebbIndex * ebbi) { + eBBlock ** ebbs = ebbi->dfOrder; + int count = ebbi->count; int i; int change = 1; @@ -193,15 +198,14 @@ computeDataFlow (eBBlock ** ebbs, int count) /* get blocks that can come to this block */ pred = edgesTo (ebbs[i]); - /* make a copy of the outExpressions or outDefs : to be */ + /* make a copy of the outExpressions and outDefs : to be */ /* used for iteration */ if (optimize.global_cse) { oldOutExprs = setFromSet (ebbs[i]->outExprs); oldKilledExprs = setFromSet (ebbs[i]->killedExprs); } - else - oldOutDefs = bitVectCopy (ebbs[i]->outDefs); + oldOutDefs = bitVectCopy (ebbs[i]->outDefs); setToNull ((void *) &ebbs[i]->inDefs); /* indefitions are easy just merge them by union */ @@ -223,7 +227,7 @@ computeDataFlow (eBBlock ** ebbs, int count) /* get the immediate dominator and put it there */ if (!pBlock) { - eBBlock *idom = immedDom (ebbs, ebbs[i]); + eBBlock *idom = immedDom (ebbi, ebbs[i]); if (idom) addSetHead (&pred, idom); } @@ -240,7 +244,7 @@ computeDataFlow (eBBlock ** ebbs, int count) /* do cse with computeOnly flag set to TRUE */ /* this by far the quickest way of computing */ - cseBBlock (ebbs[i], TRUE, ebbs, count); + cseBBlock (ebbs[i], TRUE, ebbi); /* if it change we will need to iterate */ if (optimize.global_cse) @@ -248,8 +252,7 @@ computeDataFlow (eBBlock ** ebbs, int count) change += !isSetsEqualWith (ebbs[i]->outExprs, oldOutExprs, isCseDefEqual); change += !isSetsEqualWith (ebbs[i]->killedExprs, oldKilledExprs, isCseDefEqual); } - else - change += !bitVectEqual (ebbs[i]->outDefs, oldOutDefs); + change += !bitVectEqual (ebbs[i]->outDefs, oldOutDefs); } if (!change) /* iterate till no change */