Skip to content
Merged
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
29 changes: 12 additions & 17 deletions src/coreclr/jit/liveness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,23 @@ void Compiler::fgMarkUseDef(GenTreeLclVarCommon* tree)

if (promotionType != PROMOTION_TYPE_NONE)
{
VARSET_TP bitMask(VarSetOps::MakeEmpty(this));

for (unsigned i = varDsc->lvFieldLclStart; i < varDsc->lvFieldLclStart + varDsc->lvFieldCnt; ++i)
{
noway_assert(lvaTable[i].lvIsStructField);
if (lvaTable[i].lvTracked)
if (!lvaTable[i].lvTracked)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like bitMask above is now dead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

{
noway_assert(lvaTable[i].lvVarIndex < lvaTrackedCount);
VarSetOps::AddElemD(this, bitMask, lvaTable[i].lvVarIndex);
continue;
}
}

// For pure defs (i.e. not an "update" def which is also a use), add to the (all) def set.
if (!isUse)
{
assert(isDef);
VarSetOps::UnionD(this, fgCurDefSet, bitMask);
}
else if (!VarSetOps::IsSubset(this, bitMask, fgCurDefSet))
{
// Mark as used any struct fields that are not yet defined.
VarSetOps::UnionD(this, fgCurUseSet, bitMask);
unsigned varIndex = lvaTable[i].lvVarIndex;
if (isUse && !VarSetOps::IsMember(this, fgCurDefSet, varIndex))
{
VarSetOps::AddElemD(this, fgCurUseSet, varIndex);
}

if (isDef)
{
VarSetOps::AddElemD(this, fgCurDefSet, varIndex);
}
}
}
}
Expand Down