- set *cseSet ;
- iCode *ic ;
- int change = 0 ;
- int i;
- set *ptrSetSet = NULL;
-
- /* if this block is not reachable */
- if (ebb->noPath)
- return change;
-
- /* set of common subexpressions */
- cseSet = setFromSet (ebb->inExprs) ;
-
- /* these will be computed by this routine */
- setToNull ((void **)&ebb->outDefs);
- setToNull ((void **)&ebb->defSet);
- setToNull ((void **)&ebb->usesDefs);
- setToNull ((void **)&ebb->ptrsSet);
- setToNull ((void **)&ebb->addrOf);
- setToNull ((void **)&ebb->ldefs);
-
- ebb->outDefs = bitVectCopy (ebb->inDefs);
- bitVectDefault = iCodeKey;
- ebb->defSet = newBitVect(iCodeKey);
- ebb->usesDefs=newBitVect(iCodeKey);
-
- /* for all the instructions in this block do */
- for (ic = ebb->sch ; ic ; ic = ic->next ) {
-
- iCode *pdic;
- operand *pdop ;
- iCode *defic;
-
- if (SKIP_IC2(ic))
- continue ;
-
- /* clear the def & use chains for the operands involved */
- /* in this operation . since it can change due to opts */
- unsetDefsAndUses (ic);
-
- if ( ic->op == PCALL || ic->op == CALL || ic->op == RECEIVE) {
- /* add to defSet of the symbol */
- OP_DEFS(IC_RESULT(ic)) =
- bitVectSetBit (OP_DEFS(IC_RESULT(ic)),ic->key);
- /* add to the definition set of this block */
- ebb->defSet = bitVectSetBit (ebb->defSet,ic->key);
- ebb->ldefs = bitVectSetBit (ebb->ldefs,ic->key);
- ebb->outDefs= bitVectCplAnd (ebb->outDefs,OP_DEFS(IC_RESULT(ic)));
- setUsesDefs(IC_RESULT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
- /* delete global variables from the cseSet
- since they can be modified by the function call */
- deleteItemIf(&cseSet,ifDefGlobal);
+ set *cseSet;
+ iCode *ic;
+ int change = 0;
+ int i;
+ set *ptrSetSet = NULL;
+ cseDef *expr;
+
+ /* if this block is not reachable */
+ if (ebb->noPath)
+ return 0;
+
+ /* set of common subexpressions */
+ cseSet = setFromSet (ebb->inExprs);
+
+ /* these will be computed by this routine */
+ setToNull ((void *) &ebb->outDefs);
+ setToNull ((void *) &ebb->defSet);
+ setToNull ((void *) &ebb->usesDefs);
+ setToNull ((void *) &ebb->ptrsSet);
+ setToNull ((void *) &ebb->addrOf);
+ setToNull ((void *) &ebb->ldefs);
+
+ ebb->outDefs = bitVectCopy (ebb->inDefs);
+ bitVectDefault = iCodeKey;
+ ebb->defSet = newBitVect (iCodeKey);
+ ebb->usesDefs = newBitVect (iCodeKey);
+
+ /* for all the instructions in this block do */
+ for (ic = ebb->sch; ic; ic = ic->next)
+ {
+ iCode *pdic;
+ operand *pdop;
+ iCode *defic;
+ int checkSign ;
+
+ ic->eBBlockNum = ebb->bbnum;
+
+ if (SKIP_IC2 (ic))
+ continue;
+
+ /* if this is an assignment from true symbol
+ to a temp then do pointer post inc/dec optimzation */
+ if (ic->op == '=' && !POINTER_SET (ic) &&
+ IS_PTR (operandType (IC_RESULT (ic))))
+ {
+ ptrPostIncDecOpt (ic);
+ }
+
+ /* clear the def & use chains for the operands involved */
+ /* in this operation . since it can change due to opts */
+ unsetDefsAndUses (ic);
+
+ if (ic->op == PCALL || ic->op == CALL || ic->op == RECEIVE)
+ {
+ /* add to defSet of the symbol */
+ OP_DEFS(IC_RESULT (ic))=
+ bitVectSetBit (OP_DEFS (IC_RESULT (ic)), ic->key);
+ /* add to the definition set of this block */
+ ebb->defSet = bitVectSetBit (ebb->defSet, ic->key);
+ ebb->ldefs = bitVectSetBit (ebb->ldefs, ic->key);
+ ebb->outDefs = bitVectCplAnd (ebb->outDefs, OP_DEFS (IC_RESULT (ic)));
+ setUsesDefs (IC_RESULT (ic), ebb->defSet, ebb->outDefs, &ebb->usesDefs);
+ /* delete global variables from the cseSet
+ since they can be modified by the function call */
+ deleteItemIf (&cseSet, ifDefGlobal);
+
+ /* and also itemps derived from globals */
+ deleteItemIf (&cseSet, ifFromGlobal);
+
+ /* delete all getpointer iCodes from cseSet, this should
+ be done only for global arrays & pointers but at this
+ point we don't know if globals, so to be safe do all */
+ deleteItemIf (&cseSet, ifAnyGetPointer);
+
+ /* can't cache pointer set/get operations across a call */
+ deleteSet (&ptrSetSet);