X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fxa51%2Fralloc.c;h=7274ca78dcff2d4c554acb365abda645769acb0a;hb=7bd65e1fe4f20a1fbfd8efee29982849824704bd;hp=037e79830a8d88a10e18fd8d78ebcececbf1167a;hpb=0f13c644cfaea92c44ee33764cce21da520676f1;p=fw%2Fsdcc diff --git a/src/xa51/ralloc.c b/src/xa51/ralloc.c index 037e7983..7274ca78 100755 --- a/src/xa51/ralloc.c +++ b/src/xa51/ralloc.c @@ -1883,8 +1883,6 @@ static void packRegisters (eBBlock * ebp) { iCode *ic; int change = 0; - return; // that's it for now - while (1) { change = 0; @@ -1899,6 +1897,24 @@ static void packRegisters (eBBlock * ebp) { for (ic = ebp->sch; ic; ic = ic->next) { + /* if the condition of an if instruction + is defined in the previous instruction and + this is the only usage then + mark the itemp as a conditional */ + if ((IS_CONDITIONAL (ic) || + (IS_BITWISE_OP(ic) && isBitwiseOptimizable (ic)))) { + if (ic->next && ic->next->op == IFX && + bitVectnBitsOn (OP_USES(IC_RESULT(ic)))==1 && + isOperandEqual (IC_RESULT (ic), IC_COND (ic->next)) && + OP_SYMBOL (IC_RESULT (ic))->liveTo <= ic->next->seq) { + OP_SYMBOL (IC_RESULT (ic))->regType = REG_CND; + continue; + } + } + + // that's all for now + continue; + /* if this is an itemp & result of an address of a true sym then mark this as rematerialisable */ if (ic->op == ADDRESS_OF && @@ -1966,21 +1982,6 @@ static void packRegisters (eBBlock * ebp) { if (POINTER_GET (ic)) OP_SYMBOL (IC_LEFT (ic))->uptr = 1; - /* if the condition of an if instruction - is defined in the previous instruction and - this is the only usage then - mark the itemp as a conditional */ - if ((IS_CONDITIONAL (ic) || - (IS_BITWISE_OP(ic) && isBitwiseOptimizable (ic))) && - ic->next && ic->next->op == IFX && - bitVectnBitsOn (OP_USES(IC_RESULT(ic)))==1 && - isOperandEqual (IC_RESULT (ic), IC_COND (ic->next)) && - OP_SYMBOL (IC_RESULT (ic))->liveTo <= ic->next->seq) - { - OP_SYMBOL (IC_RESULT (ic))->regType = REG_CND; - continue; - } - /* reduce for support function calls */ if (ic->supportRtn || ic->op == '+' || ic->op == '-') packRegsForSupport (ic, ebp);