}
aloop->entry = ep->to;
+
/* set max & min dfNum for loopRegion */
for ( block = setFirstItem(aloop->regBlocks); block;
block = setNextItem(aloop->regBlocks)) {
/* all blocks that have dfnumbers between dfMin & dfMax are also
part of loop */
for (i = 0 ; i < count ; i++) {
- if (ebbs[i]->dfnum > dfMin &&
- ebbs[i]->dfnum < dfMax &&
+ if (ebbs[i]->dfnum > dfMin &&
+ ebbs[i]->dfnum < dfMax &&
!isinSet(aloop->regBlocks,ebbs[i])) {
- if (!ebbs[i]->partOfLoop) ebbs[i]->partOfLoop = aloop;
+ if (!ebbs[i]->partOfLoop) {
+ ebbs[i]->partOfLoop = aloop;
+ }
}
}
+ /* and if this is a conditional block, the other side of the IFX
+ (if any, that could have a greater dfnum) is too */
+ {
+ // just a burp, but I'm getting close :)
+ }
+
+
/* now add it to the set */
addSetHead (allRegion, aloop);
return 0;
int lin, rin;
cseDef *ivar;
- /* jwk: TODO this is only needed if the call is between
+ /* TODO this is only needed if the call is between
here and the definition, but I am too lazy to do that now */
/* if there are function calls in this block */
iCode *newic = newiCode ('=', NULL,
operandFromOperand (IC_RIGHT (ic)));
IC_RESULT (newic) = operandFromOperand (IC_RESULT (ic));
- OP_DEFS_SET ((IC_RESULT (newic)),
- bitVectSetBit (OP_DEFS (IC_RESULT (newic)), newic->key));
- OP_USES_SET ((IC_RIGHT (newic)),
- bitVectSetBit (OP_USES (IC_RIGHT (newic)), newic->key));
+ OP_DEFS(IC_RESULT (newic))=
+ bitVectSetBit (OP_DEFS (IC_RESULT (newic)), newic->key);
+ OP_USES(IC_RIGHT (newic))=
+ bitVectSetBit (OP_USES (IC_RIGHT (newic)), newic->key);
/* and add it */
if (eblock->sch && eblock->sch->op == LABEL)
addiCodeToeBBlock (eblock, newic, eblock->sch->next);
if (lp->entry == theLoop->entry)
{
theLoop->regBlocks = unionSets (theLoop->regBlocks,
- lp->regBlocks, THROW_BOTH);
+ lp->regBlocks, THROW_DEST);
lp->merged = 1;
}
}
applyToSet (allRegion, mergeInnerLoops, allRegion, &maxDepth);
maxDepth++;
+
/* now create all the exits .. also */
/* create an ordered set of loops */
/* i.e. we process loops in the inner to outer order */