未验证 提交 a7ae08b3 编写于 作者: K Kunal Pathak 提交者: GitHub

Do not perform vector save/restore around call that will never return (#62662)

* Do not perform vector save/restore around call that will never return

* First check if tree is a call

* Use the IsNoReturn() method
上级 4a488409
......@@ -6274,6 +6274,14 @@ void LinearScan::insertUpperVectorSave(GenTree* tree,
return;
}
#ifdef DEBUG
if (tree->IsCall())
{
// Make sure that we do not insert vector save before calls that does not return.
assert(!tree->AsCall()->IsNoReturn());
}
#endif
LclVarDsc* varDsc = compiler->lvaGetDesc(lclVarInterval->varNum);
assert(Compiler::varTypeNeedsPartialCalleeSave(varDsc->GetRegisterType()));
......
......@@ -1481,6 +1481,15 @@ Interval* LinearScan::getUpperVectorInterval(unsigned varIndex)
//
void LinearScan::buildUpperVectorSaveRefPositions(GenTree* tree, LsraLocation currentLoc, regMaskTP fpCalleeKillSet)
{
if ((tree != nullptr) && tree->IsCall())
{
if (tree->AsCall()->IsNoReturn())
{
// No point in having vector save/restore if the call will not return.
return;
}
}
if (enregisterLocalVars && !VarSetOps::IsEmpty(compiler, largeVectorVars))
{
// We assume that the kill set includes at least some callee-trash registers, but
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册