Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/coreclr/jit/sideeffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,17 @@ void AliasSet::AddNode(Compiler* compiler, GenTree* node)
// First, add all lclVar uses associated with the node to the set. This is necessary because the lclVar reads occur
// at the position of the user, not at the position of the GenTreeLclVar node.
node->VisitOperands([compiler, this](GenTree* operand) -> GenTree::VisitResult {
if (operand->OperIsLocalRead())
if (operand->OperIs(GT_LCL_VAR))
{
const unsigned lclNum = operand->AsLclVarCommon()->GetLclNum();
if (compiler->lvaTable[lclNum].IsAddressExposed())
unsigned lclNum = operand->AsLclVarCommon()->GetLclNum();
LclVarDsc* dsc = compiler->lvaGetDesc(operand->AsLclVarCommon());

// GT_LCL_VAR is special in that if they can be enregistered, then
// their uses might move to the user's location.
if (!dsc->lvDoNotEnregister)
{
m_readsAddressableLocation = true;
m_lclVarReads.Add(compiler, lclNum);
}

m_lclVarReads.Add(compiler, lclNum);
}
if (operand->isContained())
{
Expand Down