1 /*-------------------------------------------------------------------------
2 SDCCcse.c - source file for Common Subexpressions and other utility
4 Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 In other words, you are welcome to use, share and improve this program.
21 You are forbidden to forbid anyone else to use, share and improve
22 what you give them. Help stamp out software-hoarding!
23 -------------------------------------------------------------------------*/
28 /*-----------------------------------------------------------------*/
29 /* newCseDef - new cseDef */
30 /*-----------------------------------------------------------------*/
32 newCseDef (operand * sym, iCode * ic)
37 cdp = Safe_calloc (1, sizeof (cseDef));
48 /*-----------------------------------------------------------------*/
49 /* int isCseDefEqual - two definitions are equal */
50 /*-----------------------------------------------------------------*/
52 isCseDefEqual (void *vsrc, void *vdest)
60 return (src->key == dest->key &&
61 src->diCode == dest->diCode);
65 /*-----------------------------------------------------------------*/
66 /* pcseDef - in the cseDef */
67 /*-----------------------------------------------------------------*/
69 pcseDef (void *item, va_list ap)
77 fprintf (stdout, "**null op**");
78 printOperand (cdp->sym, stdout);
79 icTab = getTableEntry (cdp->diCode->op);
80 icTab->iCodePrint (stdout, cdp->diCode, icTab->printName);
84 /*-----------------------------------------------------------------*/
85 /* replaceAllSymBySym - replaces all operands by operand in an */
86 /* instruction chain */
87 /*-----------------------------------------------------------------*/
89 replaceAllSymBySym (iCode * ic, operand * from, operand * to, bitVect ** ndpset)
93 for (lic = ic; lic; lic = lic->next)
97 /* do the special cases first */
101 IC_COND (lic)->key == from->key)
104 bitVectUnSetBit (OP_USES (from), lic->key);
105 OP_USES (to) = bitVectSetBit (OP_USES (to), lic->key);
106 siaddr = IC_COND (lic)->isaddr;
107 IC_COND (lic) = operandFromOperand (to);
108 IC_COND (lic)->isaddr = siaddr;
114 if (lic->op == JUMPTABLE)
117 IC_JTCOND (lic)->key == from->key)
120 bitVectUnSetBit (OP_USES (from), lic->key);
121 OP_USES (to) = bitVectSetBit (OP_USES (to), lic->key);
122 siaddr = IC_COND (lic)->isaddr;
123 IC_JTCOND (lic) = operandFromOperand (to);
124 IC_JTCOND (lic)->isaddr = siaddr;
130 if (IC_RESULT (lic) && IC_RESULT (lic)->key == from->key)
132 /* maintain du chains */
133 if (POINTER_SET (lic))
135 bitVectUnSetBit (OP_USES (from), lic->key);
136 OP_USES (to) = bitVectSetBit (OP_USES (to), lic->key);
138 /* also check if the "from" was in the non-dominating
139 pointer sets and replace it with "to" in the bitVector */
140 if (bitVectBitValue (*ndpset, from->key))
142 bitVectUnSetBit (*ndpset, from->key);
143 bitVectSetBit (*ndpset, to->key);
149 bitVectUnSetBit (OP_DEFS (from), lic->key);
150 OP_DEFS (to) = bitVectSetBit (OP_DEFS (to), lic->key);
152 siaddr = IC_RESULT (lic)->isaddr;
153 IC_RESULT (lic) = operandFromOperand (to);
154 IC_RESULT (lic)->isaddr = siaddr;
158 IC_RIGHT (lic) && IC_RIGHT (lic)->key == from->key)
160 bitVectUnSetBit (OP_USES (from), lic->key);
161 OP_USES (to) = bitVectSetBit (OP_USES (to), lic->key);
162 siaddr = IC_RIGHT (lic)->isaddr;
163 IC_RIGHT (lic) = operandFromOperand (to);
164 IC_RIGHT (lic)->isaddr = siaddr;
168 IC_LEFT (lic) && IC_LEFT (lic)->key == from->key)
170 bitVectUnSetBit (OP_USES (from), lic->key);
171 OP_USES (to) = bitVectSetBit (OP_USES (to), lic->key);
172 siaddr = IC_LEFT (lic)->isaddr;
173 IC_LEFT (lic) = operandFromOperand (to);
174 IC_LEFT (lic)->isaddr = siaddr;
179 /*-----------------------------------------------------------------*/
180 /* iCodeKeyIs - if the icode keys match then return 1 */
181 /*-----------------------------------------------------------------*/
182 DEFSETFUNC (iCodeKeyIs)
187 if (cdp->diCode->key == key)
193 /*-----------------------------------------------------------------*/
194 /* removeFromInExprs - removes an icode from inexpressions */
195 /*-----------------------------------------------------------------*/
196 DEFSETFUNC (removeFromInExprs)
200 V_ARG (operand *, from);
201 V_ARG (operand *, to);
202 V_ARG (eBBlock *, cbp);
208 deleteItemIf (&ebp->inExprs, iCodeKeyIs, ic->key);
209 if (ebp != cbp && !bitVectBitValue (cbp->domVect, ebp->bbnum))
210 replaceAllSymBySym (ebp->sch, from, to, &ebp->ndompset);
212 applyToSet (ebp->succList, removeFromInExprs, ic, from, to, cbp);
216 /*-----------------------------------------------------------------*/
217 /* isGlobalInNearSpace - return TRUE if valriable is a globalin data */
218 /*-----------------------------------------------------------------*/
220 isGlobalInNearSpace (operand * op)
222 sym_link *type = getSpec (operandType (op));
223 /* this is 8051 specific: optimization
224 suggested by Jean-Louis VERN, with 8051s we have no
225 advantage of putting variables in near space into
227 if (isOperandGlobal (op) && !IN_FARSPACE (SPEC_OCLS (type)) &&
228 IN_DIRSPACE (SPEC_OCLS (type)))
234 /*-----------------------------------------------------------------*/
235 /* findCheaperOp - cseBBlock support routine, will check to see if */
236 /* we have a operand previously defined */
237 /*-----------------------------------------------------------------*/
238 DEFSETFUNC (findCheaperOp)
241 V_ARG (operand *, cop);
242 V_ARG (operand **, opp);
244 /* if we have already found it */
248 /* not found it yet check if this is the one */
249 /* and this is not the defining one */
250 if (cop->key == cdp->key)
253 /* do a special check this will help in */
254 /* constant propagation & dead code elim */
255 /* for assignments only */
256 if (cdp->diCode->op == '=') {
257 /* if the result is volatile then return result */
258 if (IS_OP_VOLATILE (IC_RESULT (cdp->diCode)))
259 *opp = IC_RESULT (cdp->diCode);
261 /* if this is a straight assignment and
262 left is a temp then prefer the temporary to the
264 if (!POINTER_SET (cdp->diCode) &&
265 IS_ITEMP (IC_RESULT (cdp->diCode)) &&
266 IS_TRUE_SYMOP (IC_RIGHT (cdp->diCode)))
267 *opp = IC_RESULT (cdp->diCode);
269 /* if straight assignement && and both
270 are temps then prefer the one that
271 will not need extra space to spil, also
272 take into consideration if right side
273 an induction variable
275 if (!POINTER_SET (cdp->diCode) &&
276 IS_ITEMP (IC_RESULT (cdp->diCode)) &&
277 IS_ITEMP (IC_RIGHT (cdp->diCode)) &&
278 !OP_SYMBOL (IC_RIGHT (cdp->diCode))->isind &&
279 ((!SPIL_LOC (IC_RIGHT (cdp->diCode)) &&
280 SPIL_LOC (IC_RESULT (cdp->diCode))) ||
281 (SPIL_LOC (IC_RESULT (cdp->diCode)) &&
282 SPIL_LOC (IC_RESULT (cdp->diCode)) ==
283 SPIL_LOC (IC_RIGHT (cdp->diCode)))))
284 *opp = IC_RESULT (cdp->diCode);
286 *opp = IC_RIGHT (cdp->diCode);
290 *opp = IC_RESULT (cdp->diCode);
293 /* if this is an assign to a temp. then check
294 if the right side is this then return this */
295 if (IS_TRUE_SYMOP (cop) &&
296 cdp->diCode->op == '=' &&
297 !POINTER_SET (cdp->diCode) &&
298 cop->key == IC_RIGHT (cdp->diCode)->key &&
299 !isGlobalInNearSpace (IC_RIGHT (cdp->diCode)) &&
300 IS_ITEMP (IC_RESULT (cdp->diCode)))
301 *opp = IC_RESULT (cdp->diCode);
304 (SPEC_USIGN(operandType (cop))==SPEC_USIGN(operandType (*opp))) &&
305 (SPEC_LONG(operandType (cop))==SPEC_LONG(operandType (*opp))))
308 if ((isGlobalInNearSpace (cop) &&
309 !isOperandLiteral (*opp)) ||
310 isOperandVolatile (*opp, FALSE)
317 if (cop->key == (*opp)->key)
323 if ((*opp)->isaddr != cop->isaddr && IS_ITEMP (cop))
325 *opp = operandFromOperand (*opp);
326 (*opp)->isaddr = cop->isaddr;
329 if ((*opp)->type==VALUE &&
331 !IS_SPEC(OP_SYMBOL(cop)->type)) {
332 // this could be a pointer to some space, so we can not
344 /*-----------------------------------------------------------------*/
345 /* findPointerSet - finds the right side of a pointer set op */
346 /*-----------------------------------------------------------------*/
347 DEFSETFUNC (findPointerSet)
350 V_ARG (operand *, op);
351 V_ARG (operand **, opp);
352 V_ARG (operand *, rop);
354 if (POINTER_SET (cdp->diCode) &&
355 IC_RESULT (cdp->diCode)->key == op->key &&
356 !isOperandVolatile (IC_RESULT (cdp->diCode), TRUE) &&
357 !isOperandVolatile (IC_RIGHT (cdp->diCode), TRUE) &&
358 getSize (operandType (IC_RIGHT (cdp->diCode))) ==
359 getSize (operandType (rop)))
361 *opp = IC_RIGHT (cdp->diCode);
368 /*-----------------------------------------------------------------*/
369 /* findPrevIc - cseBBlock support function will return the iCode */
370 /* which matches the current one */
371 /*-----------------------------------------------------------------*/
372 DEFSETFUNC (findPrevIc)
376 V_ARG (iCode **, icp);
378 /* if already found */
382 /* if the iCodes are the same */
383 if (isiCodeEqual (ic, cdp->diCode) &&
384 isOperandEqual (cdp->sym, IC_RESULT (cdp->diCode)))
390 /* if iCodes are not the same */
391 /* see the operands maybe interchanged */
392 if (ic->op == cdp->diCode->op &&
393 (ic->op == '+' || ic->op == '*') &&
394 isOperandEqual (IC_LEFT (ic), IC_RIGHT (cdp->diCode)) &&
395 isOperandEqual (IC_RIGHT (ic), IC_LEFT (cdp->diCode)))
404 /*-----------------------------------------------------------------*/
405 /* ifDefGlobal - if definition is global */
406 /*-----------------------------------------------------------------*/
407 DEFSETFUNC (ifDefGlobal)
411 return (isOperandGlobal (cdp->sym));
414 /*-----------------------------------------------------------------*/
415 /* ifAnyGetPointer - if get pointer icode */
416 /*-----------------------------------------------------------------*/
417 DEFSETFUNC (ifAnyGetPointer)
421 if (cdp->diCode && POINTER_GET (cdp->diCode))
426 /*-----------------------------------------------------------------*/
427 /* ifOperandsHave - if any of the operand are the same as this */
428 /*-----------------------------------------------------------------*/
429 DEFSETFUNC (ifOperandsHave)
432 V_ARG (operand *, op);
435 if (IC_LEFT (cdp->diCode) &&
436 IS_SYMOP (IC_LEFT (cdp->diCode)) &&
437 IC_LEFT (cdp->diCode)->key == op->key)
440 if (IC_RIGHT (cdp->diCode) &&
441 IS_SYMOP (IC_RIGHT (cdp->diCode)) &&
442 IC_RIGHT (cdp->diCode)->key == op->key)
445 /* or if any of the operands are volatile */
446 if (IC_LEFT (cdp->diCode) &&
447 IS_OP_VOLATILE (IC_LEFT (cdp->diCode)))
450 if (IC_RIGHT (cdp->diCode) &&
451 IS_OP_VOLATILE (IC_RIGHT (cdp->diCode)))
455 if (IC_RESULT (cdp->diCode) &&
456 IS_OP_VOLATILE (IC_RESULT (cdp->diCode)))
462 /*-----------------------------------------------------------------*/
463 /* ifDefSymIs - if a definition is found in the set */
464 /*-----------------------------------------------------------------*/
466 ifDefSymIs (set * cseSet, operand * sym)
471 if (!sym || !IS_SYMOP (sym))
473 for (sl = cseSet; sl; sl = sl->next)
476 if (loop->sym->key == sym->key)
483 /*-----------------------------------------------------------------*/
484 /* ifDefSymIsX - will return 1 if the symbols match */
485 /*-----------------------------------------------------------------*/
486 DEFSETFUNC (ifDefSymIsX)
489 V_ARG (operand *, op);
492 return cdp->sym->key == op->key;
494 return (isOperandEqual (cdp->sym, op));
499 /*-----------------------------------------------------------------*/
500 /* ifDiCodeIs - returns truw if diCode is same */
501 /*-----------------------------------------------------------------*/
503 ifDiCodeIs (set * cseSet, iCode * ic)
511 for (sl = cseSet; sl; sl = sl->next)
514 if (loop->diCode == ic)
521 /*-----------------------------------------------------------------*/
522 /* ifPointerGet - returns true if the icode is pointer get sym */
523 /*-----------------------------------------------------------------*/
524 DEFSETFUNC (ifPointerGet)
527 V_ARG (operand *, op);
528 iCode *dic = cdp->diCode;
529 operand *left = IC_LEFT (cdp->diCode);
531 if (POINTER_GET (dic) && left->key == op->key)
537 /*-----------------------------------------------------------------*/
538 /* ifPointerSet - returns true if the icode is pointer set sym */
539 /*-----------------------------------------------------------------*/
540 DEFSETFUNC (ifPointerSet)
543 V_ARG (operand *, op);
545 if (POINTER_SET (cdp->diCode) &&
546 IC_RESULT (cdp->diCode)->key == op->key)
552 /*-----------------------------------------------------------------*/
553 /* ifDiCodeIsX - will return 1 if the symbols match */
554 /*-----------------------------------------------------------------*/
555 DEFSETFUNC (ifDiCodeIsX)
560 return cdp->diCode == ic;
564 /*-----------------------------------------------------------------*/
565 /* algebraicOpts - does some algebraic optimizations */
566 /*-----------------------------------------------------------------*/
568 algebraicOpts (iCode * ic)
570 /* we don't deal with the following iCodes
581 /* if both operands present & ! IFX */
582 /* then if they are both literal we */
583 /* perform the operation right now */
584 if (IC_RESULT (ic) &&
587 IS_OP_LITERAL (IC_LEFT (ic)) &&
588 IS_OP_LITERAL (IC_RIGHT (ic)))
591 IC_RIGHT (ic) = operandOperation (IC_LEFT (ic),
594 operandType (IC_RESULT (ic)));
597 SET_RESULT_RIGHT (ic);
601 /* if not ifx & only one operand present */
602 if (IC_RESULT (ic) &&
604 IS_OP_LITERAL (IC_LEFT (ic)) &&
608 IC_RIGHT (ic) = operandOperation (IC_LEFT (ic),
611 operandType (IC_RESULT (ic)));
614 SET_RESULT_RIGHT (ic);
619 /* a special case : or in short a kludgy solution will think
620 about a better solution over a glass of wine someday */
621 if (ic->op == GET_VALUE_AT_ADDRESS)
624 if (IS_ITEMP (IC_RESULT (ic)) &&
625 IS_TRUE_SYMOP (IC_LEFT (ic)))
629 IC_RIGHT (ic) = operandFromOperand (IC_LEFT (ic));
630 IC_RIGHT (ic)->isaddr = 0;
632 IC_RESULT (ic) = operandFromOperand (IC_RESULT (ic));
633 IC_RESULT (ic)->isaddr = 0;
634 setOperandType (IC_RESULT (ic), operandType (IC_RIGHT (ic)));
638 if (IS_ITEMP (IC_LEFT (ic)) &&
639 IS_ITEMP (IC_RESULT (ic)) &&
640 /* !OP_SYMBOL(IC_RESULT(ic))->isreqv && */
641 /* !OP_SYMBOL(IC_LEFT(ic))->isreqv && */
642 !IC_LEFT (ic)->isaddr)
645 IC_RIGHT (ic) = operandFromOperand (IC_LEFT (ic));
646 IC_RIGHT (ic)->isaddr = 0;
647 IC_RESULT (ic) = operandFromOperand (IC_RESULT (ic));
648 IC_RESULT (ic)->isaddr = 0;
656 /* depending on the operation */
660 /* if adding the same thing change to left shift by 1 */
661 if (IC_LEFT (ic)->key == IC_RIGHT (ic)->key &&
662 !IS_FLOAT (operandType (IC_RESULT (ic))))
665 IC_RIGHT (ic) = operandFromLit (1);
668 /* if addition then check if one of them is a zero */
669 /* if yes turn it into assignmnt */
670 if (IS_OP_LITERAL (IC_LEFT (ic)) &&
671 operandLitValue (IC_LEFT (ic)) == 0.0)
676 SET_ISADDR (IC_RESULT (ic), 0);
677 SET_ISADDR (IC_RIGHT (ic), 0);
680 if (IS_OP_LITERAL (IC_RIGHT (ic)) &&
681 operandLitValue (IC_RIGHT (ic)) == 0.0)
685 IC_RIGHT (ic) = IC_LEFT (ic);
687 SET_ISADDR (IC_RIGHT (ic), 0);
688 SET_ISADDR (IC_RESULT (ic), 0);
693 /* if subtracting the the same thing then zero */
694 if (IC_LEFT (ic)->key == IC_RIGHT (ic)->key)
697 IC_RIGHT (ic) = operandFromLit (0);
699 IC_RESULT (ic) = operandFromOperand (IC_RESULT (ic));
700 IC_RESULT (ic)->isaddr = 0;
704 /* if subtraction then check if one of the operand */
705 /* is zero then depending on which operand change */
706 /* to assignment or unary minus */
707 if (IS_OP_LITERAL (IC_RIGHT (ic)) &&
708 operandLitValue (IC_RIGHT (ic)) == 0.0)
710 /* right size zero change to assignment */
712 IC_RIGHT (ic) = IC_LEFT (ic);
714 SET_ISADDR (IC_RIGHT (ic), 0);
715 SET_ISADDR (IC_RESULT (ic), 0);
718 if (IS_OP_LITERAL (IC_LEFT (ic)) &&
719 operandLitValue (IC_LEFT (ic)) == 0.0)
721 /* left zero turn into an unary minus */
723 IC_LEFT (ic) = IC_RIGHT (ic);
724 IC_RIGHT (ic) = NULL;
728 /* if multiplication then check if either of */
729 /* them is zero then the result is zero */
730 /* if either of them is one then result is */
733 if (IS_OP_LITERAL (IC_LEFT (ic)))
736 if (operandLitValue (IC_LEFT (ic)) == 0.0)
739 IC_RIGHT (ic) = IC_LEFT (ic);
741 SET_RESULT_RIGHT (ic);
744 if (operandLitValue (IC_LEFT (ic)) == 1.0)
748 SET_RESULT_RIGHT (ic);
753 if (IS_OP_LITERAL (IC_RIGHT (ic)))
756 if (operandLitValue (IC_RIGHT (ic)) == 0.0)
760 SET_RESULT_RIGHT (ic);
764 if (operandLitValue (IC_RIGHT (ic)) == 1.0)
767 IC_RIGHT (ic) = IC_LEFT (ic);
769 SET_RESULT_RIGHT (ic);
775 /* if division by self then 1 */
776 if (IC_LEFT (ic)->key == IC_RIGHT (ic)->key)
779 IC_RIGHT (ic) = operandFromLit (1);
781 IC_RESULT (ic) = operandFromOperand (IC_RESULT (ic));
782 IC_RESULT (ic)->isaddr = 0;
784 /* if this is a division then check if right */
785 /* is one then change it to an assignment */
786 if (IS_OP_LITERAL (IC_RIGHT (ic)) &&
787 operandLitValue (IC_RIGHT (ic)) == 1.0)
791 IC_RIGHT (ic) = IC_LEFT (ic);
793 SET_RESULT_RIGHT (ic);
797 /* if both are the same for an comparison operators */
801 if (isOperandEqual (IC_LEFT (ic), IC_RIGHT (ic)))
804 IC_RIGHT (ic) = operandFromLit (1);
806 SET_RESULT_RIGHT (ic);
812 if (isOperandEqual (IC_LEFT (ic), IC_RIGHT (ic)))
815 IC_RIGHT (ic) = operandFromLit (0);
817 SET_RESULT_RIGHT (ic);
821 /* if this is a cast of a literal value */
822 if (IS_OP_LITERAL (IC_RIGHT (ic)))
826 operandFromValue (valCastLiteral (operandType (IC_LEFT (ic)),
827 operandLitValue (IC_RIGHT (ic))));
829 SET_ISADDR (IC_RESULT (ic), 0);
831 /* if casting to the same */
832 if (compareType (operandType (IC_RESULT (ic)),
833 operandType (IC_RIGHT (ic))) == 1)
837 SET_ISADDR (IC_RESULT (ic), 0);
841 if (IS_OP_LITERAL (IC_LEFT (ic)))
845 (operandLitValue (IC_LEFT (ic)) == 0 ?
846 operandFromLit (1) : operandFromLit (0));
848 SET_ISADDR (IC_RESULT (ic), 0);
854 #define OTHERS_PARM(s) (s->_isparm && !s->ismyparm)
855 /*-----------------------------------------------------------------*/
856 /* updateSpillLocation - keeps track of register spill location */
857 /*-----------------------------------------------------------------*/
859 updateSpillLocation (iCode * ic, int induction)
864 if (POINTER_SET (ic))
870 /* for the form true_symbol := iTempNN */
871 if (ASSIGN_ITEMP_TO_SYM (ic) &&
872 !SPIL_LOC (IC_RIGHT (ic))) {
874 setype = getSpec (operandType (IC_RESULT (ic)));
876 if (!OP_SYMBOL(IC_RIGHT (ic))->noSpilLoc &&
877 !IS_VOLATILE (setype) &&
878 !IN_FARSPACE (SPEC_OCLS (setype)) &&
879 !OTHERS_PARM (OP_SYMBOL (IC_RESULT (ic))))
881 SPIL_LOC (IC_RIGHT (ic)) =
882 IC_RESULT (ic)->operand.symOperand;
885 if (ASSIGN_ITEMP_TO_ITEMP (ic)) {
887 if (!SPIL_LOC (IC_RIGHT (ic)) &&
888 !bitVectBitsInCommon (OP_DEFS (IC_RIGHT (ic)), OP_USES (IC_RESULT (ic))) &&
889 OP_SYMBOL (IC_RESULT (ic))->isreqv) {
891 setype = getSpec (operandType (IC_RESULT (ic)));
893 if (!OP_SYMBOL(IC_RIGHT (ic))->noSpilLoc &&
894 !IS_VOLATILE (setype) &&
895 !IN_FARSPACE (SPEC_OCLS (setype)) &&
896 !OTHERS_PARM (OP_SYMBOL (IC_RESULT (ic))))
898 SPIL_LOC (IC_RIGHT (ic)) =
899 SPIL_LOC (IC_RESULT (ic));
901 /* special case for inductions */
903 OP_SYMBOL(IC_RIGHT(ic))->isreqv &&
904 !SPIL_LOC(IC_RESULT(ic))) {
905 SPIL_LOC (IC_RESULT (ic)) = SPIL_LOC (IC_RIGHT (ic));
909 /*-----------------------------------------------------------------*/
910 /* setUsesDef - sets the uses def bitvector for a given operand */
911 /*-----------------------------------------------------------------*/
913 setUsesDefs (operand * op, bitVect * bdefs,
914 bitVect * idefs, bitVect ** oud)
916 /* compute the definitions alive at this point */
917 bitVect *adefs = bitVectUnion (bdefs, idefs);
919 /* of these definitions find the ones that are */
920 /* for this operand */
921 adefs = bitVectIntersect (adefs, OP_DEFS (op));
923 /* these are the definitions that this operand can use */
924 op->usesDefs = adefs;
926 /* the out defs is an union */
927 *oud = bitVectUnion (*oud, adefs);
930 /*-----------------------------------------------------------------*/
931 /* unsetDefsAndUses - clear this operation for the operands */
932 /*-----------------------------------------------------------------*/
934 unsetDefsAndUses (iCode * ic)
936 if (ic->op == JUMPTABLE)
939 /* take away this definition from the def chain of the */
940 /* result & take away from use set of the operands */
943 /* turn off def set */
944 if (IS_SYMOP (IC_RESULT (ic)))
946 if (!POINTER_SET (ic))
947 bitVectUnSetBit (OP_DEFS (IC_RESULT (ic)), ic->key);
949 bitVectUnSetBit (OP_USES (IC_RESULT (ic)), ic->key);
951 /* turn off the useSet for the operands */
952 if (IS_SYMOP (IC_LEFT (ic)))
953 bitVectUnSetBit (OP_USES (IC_LEFT (ic)), ic->key);
955 if (IS_SYMOP (IC_RIGHT (ic)))
956 bitVectUnSetBit (OP_USES (IC_RIGHT (ic)), ic->key);
959 /* must be ifx turn off the use */ if (IS_SYMOP (IC_COND (ic)))
960 bitVectUnSetBit (OP_USES (IC_COND (ic)), ic->key);
963 /*-----------------------------------------------------------------*/
964 /* ifxOptimize - changes ifx conditions if it can */
965 /*-----------------------------------------------------------------*/
967 ifxOptimize (iCode * ic, set * cseSet,
969 eBBlock * ebb, int *change,
970 eBBlock ** ebbs, int count)
975 /* if the condition can be replaced */
979 applyToSetFTrue (cseSet, findCheaperOp, IC_COND (ic), &pdop);
987 /* if the conditional is a literal then */
988 if (IS_OP_LITERAL (IC_COND (ic)))
991 if ((operandLitValue (IC_COND (ic)) != 0.0) && IC_TRUE (ic))
994 /* change to a goto */
996 IC_LABEL (ic) = IC_TRUE (ic);
1003 if (!operandLitValue (IC_COND (ic)) && IC_FALSE (ic))
1006 IC_LABEL (ic) = IC_FALSE (ic);
1012 /* then kill this if condition */
1013 remiCodeFromeBBlock (ebb, ic);
1017 /* now we need to recompute the control flow */
1018 /* since the control flow has changed */
1019 /* this is very expensive but it does not happen */
1020 /* too often, if it does happen then the user pays */
1022 computeControlFlow (ebbs, count, 1);
1023 werror (W_CONTROL_FLOW, ic->filename, ic->lineno);
1027 /* if there is only one successor and that successor
1028 is the same one we are conditionally going to then
1029 we can remove this conditional statement */
1030 label = (IC_TRUE (ic) ? IC_TRUE (ic) : IC_FALSE (ic));
1031 if (elementsInSet (ebb->succList) == 1 &&
1032 isinSet (ebb->succList, eBBWithEntryLabel (ebbs, label, count)))
1035 remiCodeFromeBBlock (ebb, ic);
1036 computeControlFlow (ebbs, count, 1);
1037 werror (W_CONTROL_FLOW, ic->filename, ic->lineno);
1042 /* if it remains an IFX the update the use Set */
1043 OP_USES (IC_COND (ic)) = bitVectSetBit (OP_USES (IC_COND (ic)), ic->key);
1044 setUsesDefs (IC_COND (ic), ebb->defSet, ebb->outDefs, &ebb->usesDefs);
1048 /*-----------------------------------------------------------------*/
1049 /* diCodeForSym - finds the definiting instruction for a symbol */
1050 /*-----------------------------------------------------------------*/
1051 DEFSETFUNC (diCodeForSym)
1054 V_ARG (operand *, sym);
1055 V_ARG (iCode **, dic);
1057 /* if already found */
1061 /* if not if this is the defining iCode */
1062 if (sym->key == cdp->key)
1071 /*-----------------------------------------------------------------*/
1072 /* constFold - does some constant folding */
1073 /*-----------------------------------------------------------------*/
1075 constFold (iCode * ic, set * cseSet)
1079 /* this routine will change
1085 /* deal with only + & - */
1086 if (ic->op != '+' &&
1090 /* this check is a hueristic to prevent live ranges
1091 from becoming too long */
1092 if (IS_PTR (operandType (IC_RESULT (ic))))
1095 /* check if operation with a literal */
1096 if (!IS_OP_LITERAL (IC_RIGHT (ic)))
1099 /* check if we can find a definition for the
1101 if (!(applyToSet (cseSet, diCodeForSym, IC_LEFT (ic), &dic)))
1104 /* check that this is also a +/- */
1105 if (dic->op != '+' && dic->op != '-')
1108 /* with a literal */
1109 if (!IS_OP_LITERAL (IC_RIGHT (dic)))
1112 /* find the definition of the left operand
1113 of dic.then check if this defined with a
1114 get_pointer return 0 if the pointer size is
1115 less than 2 (MCS51 specific) */
1116 if (!(applyToSet (cseSet, diCodeForSym, IC_LEFT (dic), &ldic)))
1119 if (POINTER_GET (ldic) && getSize (operandType (IC_LEFT (ldic))) <= 1)
1122 /* it is if the operations are the same */
1123 /* the literal parts need to be added */
1124 IC_LEFT (ic) = operandFromOperand (IC_LEFT (dic));
1125 if (ic->op == dic->op)
1126 IC_RIGHT (ic) = operandFromLit (operandLitValue (IC_RIGHT (ic)) +
1127 operandLitValue (IC_RIGHT (dic)));
1129 IC_RIGHT (ic) = operandFromLit (operandLitValue (IC_RIGHT (ic)) -
1130 operandLitValue (IC_RIGHT (dic)));
1132 if (IS_ITEMP (IC_RESULT (ic)))
1134 SPIL_LOC (IC_RESULT (ic)) = NULL;
1135 OP_SYMBOL(IC_RESULT (ic))->noSpilLoc = 1;
1142 /*-----------------------------------------------------------------*/
1143 /* deleteGetPointers - called when a pointer is passed as parm */
1144 /* will delete from cseSet all get pointers computed from this */
1145 /* pointer. A simple ifOperandsHave is not good enough here */
1146 /*-----------------------------------------------------------------*/
1148 deleteGetPointers (set ** cseSet, set ** pss, operand * op, eBBlock * ebb)
1150 set *compItems = NULL;
1155 if (!*cseSet && !*pss)
1158 /* first find all items computed from this operand .
1159 This done fairly simply go thru the list and find
1160 those that are computed by arthimetic with this
1162 for (cdp = setFirstItem (*cseSet); cdp; cdp = setNextItem (*cseSet))
1164 if (IS_ARITHMETIC_OP (cdp->diCode))
1166 if (isOperandEqual (IC_LEFT (cdp->diCode), op) ||
1167 isOperandEqual (IC_RIGHT (cdp->diCode), op))
1169 /* save it in our list of items */
1170 addSet (&compItems, IC_RESULT (cdp->diCode));
1172 /* also check for those computed from our computed
1173 list . This will take care of situations like
1174 iTemp1 = iTemp0 + 8;
1175 iTemp2 = iTemp1 + 8; */
1176 if (isinSetWith (compItems, (void*)IC_LEFT (cdp->diCode),
1177 (insetwithFunc)isOperandEqual) ||
1178 isinSetWith (compItems, (void*)IC_RIGHT (cdp->diCode),
1179 (insetwithFunc)isOperandEqual))
1181 addSet (&compItems, IC_RESULT (cdp->diCode));
1186 /* now delete all pointer gets with this op */
1187 deleteItemIf (cseSet, ifPointerGet, op);
1188 deleteItemIf (pss, ifPointerSet, op);
1190 /* set the bit vector used by dataFlow computation later */
1191 ebb->ptrsSet = bitVectSetBit (ebb->ptrsSet, op->key);
1192 /* now for the computed items */
1193 for (cop = setFirstItem (compItems); cop; cop = setNextItem (compItems))
1195 ebb->ptrsSet = bitVectSetBit (ebb->ptrsSet, cop->key);
1196 deleteItemIf (cseSet, ifPointerGet, cop);
1197 deleteItemIf (pss, ifPointerSet, cop);
1201 /*-----------------------------------------------------------------*/
1202 /* delGetPointerSucc - delete get pointer from inExprs of succ with */
1203 /* dfnum > supplied */
1204 /*-----------------------------------------------------------------*/
1205 DEFSETFUNC (delGetPointerSucc)
1207 eBBlock *ebp = item;
1208 V_ARG (operand *, op);
1215 if (ebp->dfnum > dfnum)
1217 deleteItemIf (&ebp->inExprs, ifPointerGet, op);
1220 return applyToSet (ebp->succList, delGetPointerSucc, op, dfnum);
1223 /*-----------------------------------------------------------------*/
1224 /* fixUpTypes - KLUGE HACK fixup a lowering problem */
1225 /*-----------------------------------------------------------------*/
1227 fixUpTypes (iCode * ic)
1229 sym_link *t1 = operandType (IC_LEFT (ic)), *t2;
1231 if (TARGET_IS_DS390)
1237 /* for pointer_gets if the types of result & left r the
1238 same then change it type of result to next */
1240 compareType (t2 = operandType (IC_RESULT (ic)), t1) == 1)
1242 setOperandType (IC_RESULT (ic), t2->next);
1246 /*-----------------------------------------------------------------*/
1247 /* cseBBlock - common subexpression elimination for basic blocks */
1248 /* this is the hackiest kludgiest routine in the whole */
1249 /* system. also the most important, since almost all */
1250 /* data flow related information is computed by it */
1251 /*-----------------------------------------------------------------*/
1253 cseBBlock (eBBlock * ebb, int computeOnly,
1254 eBBlock ** ebbs, int count)
1260 set *ptrSetSet = NULL;
1262 /* if this block is not reachable */
1266 /* set of common subexpressions */
1267 cseSet = setFromSet (ebb->inExprs);
1269 /* these will be computed by this routine */
1270 setToNull ((void **) &ebb->outDefs);
1271 setToNull ((void **) &ebb->defSet);
1272 setToNull ((void **) &ebb->usesDefs);
1273 setToNull ((void **) &ebb->ptrsSet);
1274 setToNull ((void **) &ebb->addrOf);
1275 setToNull ((void **) &ebb->ldefs);
1277 ebb->outDefs = bitVectCopy (ebb->inDefs);
1278 bitVectDefault = iCodeKey;
1279 ebb->defSet = newBitVect (iCodeKey);
1280 ebb->usesDefs = newBitVect (iCodeKey);
1282 /* for all the instructions in this block do */
1283 for (ic = ebb->sch; ic; ic = ic->next)
1293 /* if this is an assignment from true symbol
1294 to a temp then do pointer post inc/dec optimzation */
1295 if (ic->op == '=' && !POINTER_SET (ic) &&
1296 IS_PTR (operandType (IC_RESULT (ic))))
1298 ptrPostIncDecOpt (ic);
1301 /* clear the def & use chains for the operands involved */
1302 /* in this operation . since it can change due to opts */
1303 unsetDefsAndUses (ic);
1305 if (ic->op == PCALL || ic->op == CALL || ic->op == RECEIVE)
1307 /* add to defSet of the symbol */
1308 OP_DEFS (IC_RESULT (ic)) =
1309 bitVectSetBit (OP_DEFS (IC_RESULT (ic)), ic->key);
1310 /* add to the definition set of this block */
1311 ebb->defSet = bitVectSetBit (ebb->defSet, ic->key);
1312 ebb->ldefs = bitVectSetBit (ebb->ldefs, ic->key);
1313 ebb->outDefs = bitVectCplAnd (ebb->outDefs, OP_DEFS (IC_RESULT (ic)));
1314 setUsesDefs (IC_RESULT (ic), ebb->defSet, ebb->outDefs, &ebb->usesDefs);
1315 /* delete global variables from the cseSet
1316 since they can be modified by the function call */
1317 deleteItemIf (&cseSet, ifDefGlobal);
1318 /* delete all getpointer iCodes from cseSet, this should
1319 be done only for global arrays & pointers but at this
1320 point we don't know if globals, so to be safe do all */
1321 deleteItemIf (&cseSet, ifAnyGetPointer);
1324 /* for pcall & ipush we need to add to the useSet */
1325 if ((ic->op == PCALL ||
1329 IS_SYMOP (IC_LEFT (ic)))
1332 /* check if they can be replaced */
1336 applyToSetFTrue (cseSet, findCheaperOp, IC_LEFT (ic), &pdop);
1338 IC_LEFT (ic) = pdop;
1340 /* the lookup could have changed it */
1341 if (IS_SYMOP (IC_LEFT (ic)))
1343 OP_USES (IC_LEFT (ic)) =
1344 bitVectSetBit (OP_USES (IC_LEFT (ic)), ic->key);
1345 setUsesDefs (IC_LEFT (ic), ebb->defSet,
1346 ebb->outDefs, &ebb->usesDefs);
1350 /* if we a sending a pointer as a parameter
1351 then kill all cse since the pointed to item
1352 might be changed in the function being called */
1353 if ((ic->op == IPUSH || ic->op == SEND) &&
1354 IS_PTR (operandType (IC_LEFT (ic))))
1356 deleteGetPointers (&cseSet, &ptrSetSet, IC_LEFT (ic), ebb);
1357 ebb->ptrsSet = bitVectSetBit (ebb->ptrsSet, IC_LEFT (ic)->key);
1358 for (i = 0; i < count; ebbs[i++]->visited = 0);
1359 applyToSet (ebb->succList, delGetPointerSucc,
1360 IC_LEFT (ic), ebb->dfnum);
1365 /* if jumptable then mark the usage */
1366 if (ic->op == JUMPTABLE)
1368 OP_USES (IC_JTCOND (ic)) =
1369 bitVectSetBit (OP_USES (IC_JTCOND (ic)), ic->key);
1370 setUsesDefs (IC_JTCOND (ic), ebb->defSet,
1371 ebb->outDefs, &ebb->usesDefs);
1378 /* do some algebraic optimizations if possible */
1380 while (constFold (ic, cseSet));
1383 if (POINTER_GET (ic) && !IS_PTR (operandType (IC_LEFT (ic))))
1385 setOperandType (IC_LEFT (ic),
1386 aggrToPtr (operandType (IC_LEFT (ic)), FALSE));
1390 if (POINTER_SET (ic) && !IS_PTR (operandType (IC_RESULT (ic))))
1392 setOperandType (IC_RESULT (ic),
1393 aggrToPtr (operandType (IC_RESULT (ic)), FALSE));
1396 /* if this is a condition statment then */
1397 /* check if the condition can be replaced */
1400 ifxOptimize (ic, cseSet, computeOnly,
1406 /* if the assignment & result is a temp */
1407 /* see if we can replace it */
1411 /* update the spill location for this */
1412 updateSpillLocation (ic,0);
1414 if (POINTER_SET (ic) &&
1415 !(IS_BITFIELD (OP_SYMBOL (IC_RESULT (ic))->etype)))
1418 applyToSetFTrue (cseSet, findCheaperOp, IC_RESULT (ic), &pdop);
1419 if (pdop && IS_ITEMP (pdop) && !computeOnly)
1420 IC_RESULT (ic) = pdop;
1424 /* do the operand lookup i.e. for both the */
1425 /* right & left operand : check the cseSet */
1426 /* to see if they have been replaced if yes */
1427 /* then replace them with those from cseSet */
1429 /* and left is a symbol */
1430 if (IS_SYMOP (IC_LEFT (ic)) &&
1431 !computeOnly && ic->op != ADDRESS_OF)
1435 applyToSetFTrue (cseSet, findCheaperOp, IC_LEFT (ic), &pdop);
1438 if (POINTER_GET (ic))
1440 if (IS_ITEMP (pdop) || IS_OP_LITERAL (pdop))
1442 IC_LEFT (ic) = pdop;
1445 /* check if there is a pointer set
1446 for the same pointer visible if yes
1447 then change this into an assignment */
1449 if (applyToSetFTrue (cseSet, findPointerSet, IC_LEFT (ic), &pdop, IC_RESULT (ic)) &&
1450 !bitVectBitValue (ebb->ptrsSet, pdop->key))
1453 IC_LEFT (ic) = NULL;
1454 IC_RIGHT (ic) = pdop;
1455 SET_ISADDR (IC_RESULT (ic), 0);
1461 IC_LEFT (ic) = pdop;
1468 if (IS_SYMOP (IC_RIGHT (ic)) && !computeOnly)
1472 applyToSetFTrue (cseSet, findCheaperOp, IC_RIGHT (ic), &pdop);
1476 IC_RIGHT (ic) = pdop;
1481 /* if left or right changed then do algebraic */
1485 while (constFold (ic, cseSet));
1488 /* if after all this it becomes a assignment to self
1489 then delete it and continue */
1490 if (ASSIGNMENT_TO_SELF (ic))
1492 remiCodeFromeBBlock (ebb, ic);
1496 /* now we will check to see if the entire */
1497 /* operation has been performed before */
1498 /* and is available */
1499 /* don't do assignments they will be killed */
1500 /* by dead code elimination if required do */
1501 /* it only if result is a temporary */
1503 if (!(POINTER_GET (ic) &&
1504 (IS_BITFIELD (OP_SYMBOL (IC_RESULT (ic))->etype) ||
1505 isOperandVolatile (IC_LEFT (ic), TRUE) ||
1506 bitVectBitValue (ebb->ndompset, IC_LEFT (ic)->key))) &&
1508 IS_ITEMP (IC_RESULT (ic)) &&
1511 applyToSet (cseSet, findPrevIc, ic, &pdic);
1512 if (pdic && compareType (operandType (IC_RESULT (pdic)),
1513 operandType (IC_RESULT (ic))) != 1)
1517 /* if found then eliminate this and add to */
1518 /* to cseSet an element containing result */
1519 /* of this with previous opcode */
1523 if (IS_ITEMP (IC_RESULT (ic)))
1526 /* replace in the remaining of this block */
1527 replaceAllSymBySym (ic->next, IC_RESULT (ic), IC_RESULT (pdic), &ebb->ndompset);
1528 /* remove this iCode from inexpressions of all
1529 its successors, it cannot be in the in expressions
1530 of any of the predecessors */
1531 for (i = 0; i < count; ebbs[i++]->visited = 0);
1532 applyToSet (ebb->succList, removeFromInExprs, ic, IC_RESULT (ic),
1533 IC_RESULT (pdic), ebb);
1535 /* if this was moved from another block */
1536 /* then replace in those blocks too */
1540 for (owner = setFirstItem (ic->movedFrom); owner;
1541 owner = setNextItem (ic->movedFrom))
1542 replaceAllSymBySym (owner->sch, IC_RESULT (ic), IC_RESULT (pdic), &owner->ndompset);
1544 pdic->movedFrom = unionSets (pdic->movedFrom, ic->movedFrom, THROW_NONE);
1547 addSetHead (&cseSet, newCseDef (IC_RESULT (ic), pdic));
1550 /* eliminate this */
1551 remiCodeFromeBBlock (ebb, ic);
1556 if (IS_ITEMP (IC_RESULT (ic)))
1563 /* just add this as a previous expression except in */
1564 /* case of a pointer access in which case this is a */
1565 /* usage not a definition */
1566 if (!(POINTER_SET (ic)) && IC_RESULT (ic))
1568 deleteItemIf (&cseSet, ifDefSymIsX, IC_RESULT (ic));
1569 addSetHead (&cseSet, newCseDef (IC_RESULT (ic), ic));
1575 /* if assignment to a parameter which is not
1576 mine and type is a pointer then delete
1577 pointerGets to take care of aliasing */
1578 if (ASSIGNMENT (ic) &&
1579 OTHERS_PARM (OP_SYMBOL (IC_RESULT (ic))) &&
1580 IS_PTR (operandType (IC_RESULT (ic))))
1582 deleteGetPointers (&cseSet, &ptrSetSet, IC_RIGHT (ic), ebb);
1583 for (i = 0; i < count; ebbs[i++]->visited = 0);
1584 applyToSet (ebb->succList, delGetPointerSucc, IC_RIGHT (ic), ebb->dfnum);
1585 ebb->ptrsSet = bitVectSetBit (ebb->ptrsSet, IC_RIGHT (ic)->key);
1588 /* if this is a pointerget then see if we can replace
1589 this with a previously assigned pointer value */
1590 if (POINTER_GET (ic) &&
1591 !(IS_BITFIELD (OP_SYMBOL (IC_RESULT (ic))->etype) ||
1592 isOperandVolatile (IC_LEFT (ic), TRUE)))
1595 applyToSet (ptrSetSet, findPointerSet, IC_LEFT (ic), &pdop, IC_RESULT (ic));
1596 /* if we find it then locally replace all
1597 references to the result with what we assigned */
1600 replaceAllSymBySym (ic->next, IC_RESULT (ic), pdop, &ebb->ndompset);
1604 /* delete from the cseSet anything that has */
1605 /* operands matching the result of this */
1606 /* except in case of pointer access */
1607 if (!(POINTER_SET (ic)) && IC_RESULT (ic))
1609 deleteItemIf (&cseSet, ifOperandsHave, IC_RESULT (ic));
1610 /* delete any previous definitions */
1611 ebb->defSet = bitVectCplAnd (ebb->defSet, OP_DEFS (IC_RESULT (ic)));
1615 /* add the left & right to the defUse set */
1616 if (IC_LEFT (ic) && IS_SYMOP (IC_LEFT (ic)))
1618 OP_USES (IC_LEFT (ic)) =
1619 bitVectSetBit (OP_USES (IC_LEFT (ic)), ic->key);
1620 setUsesDefs (IC_LEFT (ic), ebb->defSet, ebb->outDefs, &ebb->usesDefs);
1624 if (IC_RIGHT (ic) && IS_SYMOP (IC_RIGHT (ic)))
1626 OP_USES (IC_RIGHT (ic)) =
1627 bitVectSetBit (OP_USES (IC_RIGHT (ic)), ic->key);
1628 setUsesDefs (IC_RIGHT (ic), ebb->defSet, ebb->outDefs, &ebb->usesDefs);
1632 /* for the result it is special case, put the result */
1633 /* in the defuseSet if it a pointer or array access */
1634 if (POINTER_SET (defic))
1636 OP_USES (IC_RESULT (ic)) =
1637 bitVectSetBit (OP_USES (IC_RESULT (ic)), ic->key);
1638 setUsesDefs (IC_RESULT (ic), ebb->defSet, ebb->outDefs, &ebb->usesDefs);
1639 deleteItemIf (&cseSet, ifPointerGet, IC_RESULT (ic));
1640 ebb->ptrsSet = bitVectSetBit (ebb->ptrsSet, IC_RESULT (ic)->key);
1641 /* delete from inexpressions of all successors which
1642 have dfNum > than this block */
1643 for (i = 0; i < count; ebbs[i++]->visited = 0);
1644 applyToSet (ebb->succList, delGetPointerSucc, IC_RESULT (ic), ebb->dfnum);
1646 /* delete from cseSet all other pointer sets
1648 deleteItemIf (&ptrSetSet, ifPointerSet, IC_RESULT (ic));
1649 /* add to the local pointerset set */
1650 addSetHead (&ptrSetSet, newCseDef (IC_RESULT (ic), ic));
1653 /* add the result to defintion set */ if (IC_RESULT (ic))
1655 OP_DEFS (IC_RESULT (ic)) =
1656 bitVectSetBit (OP_DEFS (IC_RESULT (ic)), ic->key);
1657 ebb->defSet = bitVectSetBit (ebb->defSet, ic->key);
1658 ebb->outDefs = bitVectCplAnd (ebb->outDefs, OP_DEFS (IC_RESULT (ic)));
1659 ebb->ldefs = bitVectSetBit (ebb->ldefs, ic->key);
1663 /* if this is an addressof instruction then */
1664 /* put the symbol in the address of list & */
1665 /* delete it from the cseSet */
1666 if (defic->op == ADDRESS_OF)
1668 addSetHead (&ebb->addrOf, IC_LEFT (ic));
1669 deleteItemIf (&cseSet, ifDefSymIsX, IC_LEFT (ic));
1673 setToNull ((void **) &ebb->outExprs);
1674 ebb->outExprs = cseSet;
1675 ebb->outDefs = bitVectUnion (ebb->outDefs, ebb->defSet);
1676 ebb->ptrsSet = bitVectUnion (ebb->ptrsSet, ebb->inPtrsSet);
1680 /*-----------------------------------------------------------------*/
1681 /* cseAllBlocks - will sequentially go thru & do cse for all blocks */
1682 /*-----------------------------------------------------------------*/
1684 cseAllBlocks (eBBlock ** ebbs, int count)
1689 /* if optimization turned off */
1691 for (i = 0; i < count; i++)
1692 change += cseBBlock (ebbs[i], FALSE, ebbs, count);