- /* if after all this it becomes a assignment to self
- then delete it and continue */
- if (ASSIGNMENT_TO_SELF(ic)) {
- remiCodeFromeBBlock(ebb,ic);
- continue;
- }
-
- /* now we will check to see if the entire */
- /* operation has been performed before */
- /* and is available */
- /* don't do assignments they will be killed */
- /* by dead code elimination if required do */
- /* it only if result is a temporary */
- pdic = NULL ;
- if (!( POINTER_GET(ic) &&
- (IS_BITFIELD(OP_SYMBOL(IC_RESULT(ic))->etype) ||
- isOperandVolatile(IC_LEFT(ic),TRUE) ||
- bitVectBitValue(ebb->ndompset,IC_LEFT(ic)->key))) &&
- ! ASSIGNMENT(ic) &&
- IS_ITEMP(IC_RESULT(ic)) &&
- ! computeOnly) {
- applyToSet (cseSet,findPrevIc,ic,&pdic);
- }
-
- /* if found then eliminate this and add to*/
- /* to cseSet an element containing result */
- /* of this with previous opcode */
- if (pdic) {
-
- if (IS_ITEMP(IC_RESULT(ic))) {
-
- /* replace in the remaining of this block */
- replaceAllSymBySym(ic->next,IC_RESULT(ic),IC_RESULT(pdic),&ebb->ndompset);
- /* remove this iCode from inexpressions of all
- its successors, it cannot be in the in expressions
- of any of the predecessors */
- for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
- applyToSet(ebb->succList,removeFromInExprs,ic,IC_RESULT(ic),
- IC_RESULT(pdic),ebb);
-
- /* if this was moved from another block */
- /* then replace in those blocks too */
- if ( ic->movedFrom ) {
- eBBlock *owner ;
- for (owner = setFirstItem(ic->movedFrom); owner ;
- owner = setNextItem(ic->movedFrom))
- replaceAllSymBySym(owner->sch,IC_RESULT(ic),IC_RESULT(pdic),&owner->ndompset);
- }
- pdic->movedFrom = unionSets(pdic->movedFrom,ic->movedFrom,THROW_NONE);
- }
- else
- addSetHead (&cseSet,newCseDef(IC_RESULT(ic),pdic));
-
- if (!computeOnly)
- /* eliminate this */
- remiCodeFromeBBlock (ebb,ic);
-
- defic = pdic ;
- change++ ;
-
- if (IS_ITEMP(IC_RESULT(ic)))
- continue ;