More inter code value forwarding

This commit is contained in:
drmortalwombat 2022-01-05 16:38:56 +01:00
parent 2b7c7300d7
commit d4a9308627
2 changed files with 13 additions and 1 deletions

View File

@ -7096,6 +7096,7 @@ void InterCodeProcedure::Close(void)
bool eliminated;
int retries = 2;
//
// Now forward constant values
//
@ -7119,7 +7120,12 @@ void InterCodeProcedure::Close(void)
mEntryBlock->CollectEntries();
*/
}
} while (eliminated);
mTemporaries.SetSize(numTemps, true);
TempForwarding();
retries--;
} while (eliminated || retries > 0);
DisassembleDebug("value forwarding");

View File

@ -9355,6 +9355,12 @@ bool NativeCodeBasicBlock::PatchDirectAddressSumY(int at, int reg, int apos, int
if (last == mIns.Size())
return false;
if (mIns[last].mLive & LIVE_CPU_REG_Y)
{
mIns.Insert(last + 1, NativeCodeInstruction(ASMIT_LDY, ASMIM_IMMEDIATE, yindex));
mIns[last + 1].mLive |= CPU_REG_Y;
}
mIns[apos].mType = ASMIT_TAY;
for (int i = 0; i < 5; i++)
{