Fix assert in peephole optimizer
This commit is contained in:
parent
99da637734
commit
1f17f1c198
|
@ -13642,7 +13642,7 @@ void InterCodeBasicBlock::FollowJumps(void)
|
||||||
{
|
{
|
||||||
InterCodeBasicBlock* block = mTrueJump->Clone();
|
InterCodeBasicBlock* block = mTrueJump->Clone();
|
||||||
block->mInstructions[1]->mCode = IC_JUMP;
|
block->mInstructions[1]->mCode = IC_JUMP;
|
||||||
block->mInstructions[1]->mNumOperands = 1;
|
block->mInstructions[1]->mNumOperands = 0;
|
||||||
block->Close(mTrueJump->mTrueJump, nullptr);
|
block->Close(mTrueJump->mTrueJump, nullptr);
|
||||||
|
|
||||||
block->mTrueJump->mNumEntries++;
|
block->mTrueJump->mNumEntries++;
|
||||||
|
@ -13660,7 +13660,7 @@ void InterCodeBasicBlock::FollowJumps(void)
|
||||||
{
|
{
|
||||||
InterCodeBasicBlock* block = mFalseJump->Clone();
|
InterCodeBasicBlock* block = mFalseJump->Clone();
|
||||||
block->mInstructions[1]->mCode = IC_JUMP;
|
block->mInstructions[1]->mCode = IC_JUMP;
|
||||||
block->mInstructions[1]->mNumOperands = 1;
|
block->mInstructions[1]->mNumOperands = 0;
|
||||||
block->Close(mFalseJump->mFalseJump, nullptr);
|
block->Close(mFalseJump->mFalseJump, nullptr);
|
||||||
|
|
||||||
block->mTrueJump->mNumEntries++;
|
block->mTrueJump->mNumEntries++;
|
||||||
|
@ -16301,7 +16301,7 @@ bool InterCodeBasicBlock::PostDecLoopOptimization(void)
|
||||||
{
|
{
|
||||||
InterInstruction* ins = mInstructions[inci];
|
InterInstruction* ins = mInstructions[inci];
|
||||||
|
|
||||||
int v = ins->mSrc[inco].mIntConst;
|
int64 v = ins->mSrc[inco].mIntConst;
|
||||||
|
|
||||||
if (ins->mDst.mRange.mMaxState == IntegerValueRange::S_BOUND)
|
if (ins->mDst.mRange.mMaxState == IntegerValueRange::S_BOUND)
|
||||||
ins->mDst.mRange.mMaxValue -= v;
|
ins->mDst.mRange.mMaxValue -= v;
|
||||||
|
|
|
@ -40591,6 +40591,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
mIns[i + 0].mAddress = (mIns[i + 0].mAddress - 1) & 255;
|
mIns[i + 0].mAddress = (mIns[i + 0].mAddress - 1) & 255;
|
||||||
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
||||||
|
mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
|
@ -40599,6 +40600,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
mIns[i + 0].mAddress = (mIns[i + 0].mAddress + 1) & 255;
|
mIns[i + 0].mAddress = (mIns[i + 0].mAddress + 1) & 255;
|
||||||
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
||||||
|
mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
|
@ -40607,6 +40609,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
mIns[i + 0].mAddress = (mIns[i + 0].mAddress - 1) & 255;
|
mIns[i + 0].mAddress = (mIns[i + 0].mAddress - 1) & 255;
|
||||||
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
||||||
|
mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
|
@ -40615,6 +40618,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
mIns[i + 0].mAddress = (mIns[i + 0].mAddress + 1) & 255;
|
mIns[i + 0].mAddress = (mIns[i + 0].mAddress + 1) & 255;
|
||||||
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
||||||
|
mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40624,6 +40628,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
mIns[i + 0].mType = ASMIT_LDY; mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
mIns[i + 0].mType = ASMIT_LDY; mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
||||||
|
mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
|
@ -40632,6 +40637,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
mIns[i + 0].mType = ASMIT_LDX; mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
mIns[i + 0].mType = ASMIT_LDX; mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
||||||
|
mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
|
@ -40640,6 +40646,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
mIns[i + 0].mType = ASMIT_LDA; mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
mIns[i + 0].mType = ASMIT_LDA; mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
||||||
|
mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
|
@ -40648,6 +40655,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass
|
||||||
{
|
{
|
||||||
mIns[i + 0].mType = ASMIT_LDA; mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
mIns[i + 0].mType = ASMIT_LDA; mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED;
|
||||||
|
mIns[i + 0].mLive |= mIns[i + 1].mLive;
|
||||||
progress = true;
|
progress = true;
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
|
|
Loading…
Reference in New Issue