Fix data dependency violation in cross diamond movement
This commit is contained in:
parent
ca37ebff0b
commit
e1a30a25c7
|
@ -8846,7 +8846,10 @@ bool InterCodeBasicBlock::PushSinglePathResultInstructions(void)
|
||||||
for (int j = 0; j < ins->mNumOperands; j++)
|
for (int j = 0; j < ins->mNumOperands; j++)
|
||||||
{
|
{
|
||||||
if (ins->mSrc[j].mTemp >= 0)
|
if (ins->mSrc[j].mTemp >= 0)
|
||||||
|
{
|
||||||
trueExitRequiredTemps += ins->mSrc[j].mTemp;
|
trueExitRequiredTemps += ins->mSrc[j].mTemp;
|
||||||
|
mTrueJump->mEntryRequiredTemps += ins->mSrc[j].mTemp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mTrueJump->mInstructions.Insert(0, ins);
|
mTrueJump->mInstructions.Insert(0, ins);
|
||||||
mInstructions.Remove(i);
|
mInstructions.Remove(i);
|
||||||
|
@ -8858,7 +8861,10 @@ bool InterCodeBasicBlock::PushSinglePathResultInstructions(void)
|
||||||
for (int j = 0; j < ins->mNumOperands; j++)
|
for (int j = 0; j < ins->mNumOperands; j++)
|
||||||
{
|
{
|
||||||
if (ins->mSrc[j].mTemp >= 0)
|
if (ins->mSrc[j].mTemp >= 0)
|
||||||
|
{
|
||||||
falseExitRequiredTems += ins->mSrc[j].mTemp;
|
falseExitRequiredTems += ins->mSrc[j].mTemp;
|
||||||
|
mFalseJump->mEntryRequiredTemps += ins->mSrc[j].mTemp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mFalseJump->mInstructions.Insert(0, ins);
|
mFalseJump->mInstructions.Insert(0, ins);
|
||||||
mInstructions.Remove(i);
|
mInstructions.Remove(i);
|
||||||
|
@ -8871,7 +8877,7 @@ bool InterCodeBasicBlock::PushSinglePathResultInstructions(void)
|
||||||
!mTrueJump->mLocalUsedTemps[dtemp] && !mTrueJump->mLocalModifiedTemps[dtemp])
|
!mTrueJump->mLocalUsedTemps[dtemp] && !mTrueJump->mLocalModifiedTemps[dtemp])
|
||||||
{
|
{
|
||||||
int j = 0;
|
int j = 0;
|
||||||
while (j < ins->mNumOperands && !(ins->mSrc[j].mTemp >= 0 && (mFalseJump->mLocalModifiedTemps[dtemp] || mTrueJump->mLocalModifiedTemps[dtemp])))
|
while (j < ins->mNumOperands && !(ins->mSrc[j].mTemp >= 0 && (mFalseJump->mLocalModifiedTemps[ins->mSrc[j].mTemp] || mTrueJump->mLocalModifiedTemps[ins->mSrc[j].mTemp])))
|
||||||
j++;
|
j++;
|
||||||
|
|
||||||
if (j == ins->mNumOperands)
|
if (j == ins->mNumOperands)
|
||||||
|
|
|
@ -17323,18 +17323,22 @@ bool NativeCodeBasicBlock::MoveStoreXUp(int at)
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
mIns[at].mLive |= mIns[at - 1].mLive;
|
int live = mIns[at - 1].mLive;
|
||||||
mIns[at + n].mLive |= LIVE_CPU_REG_X;
|
mIns[at + n].mLive |= LIVE_CPU_REG_X;
|
||||||
|
|
||||||
NativeCodeInstruction ins = mIns[at - 1];
|
NativeCodeInstruction ins = mIns[at - 1];
|
||||||
if (ins.mMode == ASMIM_ABSOLUTE_X)
|
if (ins.mMode == ASMIM_ABSOLUTE_X)
|
||||||
ins.mAddress -= inc;
|
ins.mAddress -= inc;
|
||||||
|
|
||||||
if (ins.RequiresYReg()) mIns[at].mLive |= LIVE_CPU_REG_Y;
|
if (ins.RequiresCarry()) live |= LIVE_CPU_REG_C;
|
||||||
if (ins.RequiresAccu()) mIns[at].mLive |= LIVE_CPU_REG_A;
|
if (ins.RequiresYReg()) live |= LIVE_CPU_REG_Y;
|
||||||
|
if (ins.RequiresAccu()) live |= LIVE_CPU_REG_A;
|
||||||
|
|
||||||
for (int i = 0; i <= n; i++)
|
for (int i = 0; i <= n; i++)
|
||||||
|
{
|
||||||
|
mIns[at + i].mLive |= live;
|
||||||
mIns[at - 1 + i] = mIns[at + i];
|
mIns[at - 1 + i] = mIns[at + i];
|
||||||
|
}
|
||||||
mIns[at + n] = ins;
|
mIns[at + n] = ins;
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
@ -23036,6 +23040,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
(mIns[i + 2].mLive & LIVE_MEM) == 0)
|
(mIns[i + 2].mLive & LIVE_MEM) == 0)
|
||||||
{
|
{
|
||||||
mIns[i + 1].mType = mIns[i + 2].mType;
|
mIns[i + 1].mType = mIns[i + 2].mType;
|
||||||
|
mIns[i + 1].mLive |= mIns[i + 2].mLive;
|
||||||
mIns[i + 0].mType = ASMIT_NOP; mIns[i + 0].mMode = ASMIM_IMPLIED;
|
mIns[i + 0].mType = ASMIT_NOP; mIns[i + 0].mMode = ASMIM_IMPLIED;
|
||||||
mIns[i + 2].mType = ASMIT_NOP; mIns[i + 2].mMode = ASMIM_IMPLIED;
|
mIns[i + 2].mType = ASMIT_NOP; mIns[i + 2].mMode = ASMIM_IMPLIED;
|
||||||
progress = true;
|
progress = true;
|
||||||
|
|
Loading…
Reference in New Issue