Fix wrong loop invariant when result temp used before
This commit is contained in:
parent
2c9fd0e1a6
commit
a04b09c737
|
@ -18173,11 +18173,16 @@ void InterCodeBasicBlock::SingleBlockLoopOptimisation(const NumberSet& aliasedPa
|
||||||
InterInstruction* ins = mInstructions[i];
|
InterInstruction* ins = mInstructions[i];
|
||||||
|
|
||||||
if (ins->mInvariant)
|
if (ins->mInvariant)
|
||||||
|
{
|
||||||
|
if (ins->mDst.mTemp >= 0 && IsTempReferencedInRange(0, i, ins->mDst.mTemp))
|
||||||
|
ins->mInvariant = false;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for (int j = 0; j < ins->mNumOperands; j++)
|
for (int j = 0; j < ins->mNumOperands; j++)
|
||||||
if (ins->mSrc[j].mTemp >= 0 && dep[ins->mSrc[j].mTemp] == DEP_VARIABLE)
|
if (ins->mSrc[j].mTemp >= 0 && dep[ins->mSrc[j].mTemp] == DEP_VARIABLE)
|
||||||
ins->mInvariant = false;
|
ins->mInvariant = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ins->mInvariant)
|
if (ins->mInvariant)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue