未验证 提交 da828a26 编写于 作者: A Andy Ayers 提交者: GitHub

JIT: workaround for unreliable change detection in fgReorderBlocks (#48516)

This method costs trees, which can in turn modify the IR by swapping operands.
As a result the bool value returned doesn't properly reflect whether any
changes happened.

This impacts proper reporting phase status by `optOptimizeLayout'. Since phase
status just gates post-phase dumps and checks, we'll just claim this phase
always modifies IR.

Add similar workaround for `optInvertLoops`.

Fixes #48494.
Fixes #48495. 
上级 4d310fbb
......@@ -4484,7 +4484,7 @@ PhaseStatus Compiler::optInvertLoops()
}
}
const bool madeChanges = fgModified;
bool madeChanges = fgModified;
if (madeChanges)
{
......@@ -4493,6 +4493,15 @@ PhaseStatus Compiler::optInvertLoops()
fgModified = false;
}
// optInvertWhileLoop can cause IR changes even if it does not modify
// the flow graph. It calls gtPrepareCost which can cause operand swapping.
// Work around this for now.
//
// Note phase status only impacts dumping and checking done post-phase,
// it has no impact on a release build.
//
madeChanges = true;
return madeChanges ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING;
}
......@@ -4514,6 +4523,15 @@ PhaseStatus Compiler::optOptimizeLayout()
madeChanges |= fgReorderBlocks();
madeChanges |= fgUpdateFlowGraph();
// fgReorderBlocks can cause IR changes even if it does not modify
// the flow graph. It calls gtPrepareCost which can cause operand swapping.
// Work around this for now.
//
// Note phase status only impacts dumping and checking done post-phase,
// it has no impact on a release build.
//
madeChanges = true;
return madeChanges ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册