Skip to content

Commit

Permalink
Limit to GT_STORE_LCL_VAR only
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Jan 24, 2025
1 parent 9d3befe commit dbf7c21
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/coreclr/jit/fginline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ class SubstitutePlaceholdersAndDevirtualizeWalker : public GenTreeVisitor<Substi
public:
enum
{
ComputeStack = true,
DoPreOrder = true,
DoPostOrder = true,
UseExecutionOrder = true,
Expand Down Expand Up @@ -545,9 +544,7 @@ class SubstitutePlaceholdersAndDevirtualizeWalker : public GenTreeVisitor<Substi
//
// Notes:
// We conservatively consider a call can be spilled without side effects
// when it's the root node, or the root node is STORE_LCL_VAR and the tree
// is always the first operand of its parent in execution order along the
// path to the root.
// when it's the root node, or the parent node is STORE_LCL_VAR.
//
bool CanSpillCallWithoutSideEffect(GenTreeCall* call, GenTree* parent)
{
Expand All @@ -556,20 +553,7 @@ class SubstitutePlaceholdersAndDevirtualizeWalker : public GenTreeVisitor<Substi
return true;
}

if (m_ancestors.Bottom()->OperGet() != GT_STORE_LCL_VAR)
{
return false;
}

for (int idx = 0; idx < m_ancestors.Height() - 1; idx++)
{
if (m_ancestors.Top(idx) != *m_ancestors.Top(idx + 1)->OperandsBegin())
{
return false;
}
}

return true;
return false;
}

//------------------------------------------------------------------------
Expand Down

0 comments on commit dbf7c21

Please sign in to comment.