Index: working_vm/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp =================================================================== --- working_vm/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp £¨ÐÞ¶©°æ 713911£© +++ working_vm/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp £¨¹¤×÷¿½±´£© @@ -1324,8 +1324,13 @@ U_32 opndCount=getOpndCount(); for (U_32 i=0; iisPlacedIn(regKind)) - gpTotalRegUsage |= getRegMask(opnd->getRegName()); + if (opnd->isPlacedIn(regKind)) { + RegName reg = opnd->getRegName(); + unsigned mask = getRegMask(reg); + if ((reg == RegName_AH) || (reg == RegName_CH) || (reg == RegName_DH) || (reg == RegName_BH)) + mask >>= 4; + gpTotalRegUsage |= mask; + } } } //_________________________________________________________________________________________________ Index: working_vm/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp =================================================================== --- working_vm/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp £¨ÐÞ¶©°æ 713911£© +++ working_vm/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp £¨¹¤×÷¿½±´£© @@ -484,7 +484,8 @@ if (step1 && next->getMnemonic() == Mnemonic_MOV) { Opnd *movopnd1, *movopnd2, *nextmovopnd1, *nextmovopnd2; - if (inst->getKind() == Inst::Kind_CopyPseudoInst) + bool isInstCopyPseudo = (inst->getKind() == Inst::Kind_CopyPseudoInst); + if (isInstCopyPseudo) { movopnd1 = inst->getOpnd(0); movopnd2 = inst->getOpnd(1); @@ -496,7 +497,8 @@ movopnd1 = inst->getOpnd(movdefs.begin()); movopnd2 = inst->getOpnd(movuses.begin()); } - if (next->getKind() == Inst::Kind_CopyPseudoInst) + bool isNextCopyPseudo = (next->getKind() == Inst::Kind_CopyPseudoInst); + if (isNextCopyPseudo) { nextmovopnd1 = next->getOpnd(0); nextmovopnd2 = next->getOpnd(1); @@ -522,7 +524,10 @@ bool dstNotUsed = !ls.getBit(movopnd1->getId()); if (dstNotUsed) { - irManager->newInst(Mnemonic_MOV, nextmovopnd1, movopnd2)->insertAfter(inst); + if (isInstCopyPseudo && isNextCopyPseudo) + irManager->newCopyPseudoInst(Mnemonic_MOV, nextmovopnd1, movopnd2)->insertAfter(inst); + else + irManager->newInst(Mnemonic_MOV, nextmovopnd1, movopnd2)->insertAfter(inst); inst->unlink(); next->unlink(); return Changed_Node; @@ -603,7 +608,6 @@ return Changed_Nothing; } - PeepHoleOpt::Changed PeepHoleOpt::handleInst_CMP(Inst* inst) { assert(inst->getMnemonic()==Mnemonic_CMP);