int constFold (iCode *ic, set *cseSet)
{
iCode *dic = NULL;
+ iCode *ldic= NULL;
/* this routine will change
a = b + 10;
c = a + 10;
if (!IS_OP_LITERAL(IC_RIGHT(dic)))
return 0;
+ /* find the definition of the left operand
+ of dic.then check if this defined with a
+ get_pointer return 0 if the pointer size is
+ less than 2 (MCS51 specific) */
+ if (!(applyToSet(cseSet,diCodeForSym,IC_LEFT(dic),&ldic)))
+ return 0;
+
+ if (POINTER_GET(ldic) && getSize(operandType(IC_LEFT(ldic))) <= 1)
+ return 0;
+
/* it is if the operations are the same*/
/* the literal parts need to be added */
IC_LEFT(ic) = operandFromOperand(IC_LEFT(dic));
; Peephole 220b removed bogus DPS set
mov dps, #0x00
}
+
+replace {
+ mov %1 + %2,(%2 + %1)
+} by {
+ ; Peephole 221a remove redundant move
+}
+
+replace {
+ mov (%1 + %2 + %3),((%2 + %1) + %3)
+} by {
+ ; Peephole 221b remove redundant move
+}
\ No newline at end of file