Skip to content

Commit

Permalink
Add asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
SingleAccretion committed Feb 23, 2022
1 parent 654c062 commit a552f20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/coreclr/jit/copyprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ void Compiler::optCopyPropPushDef(GenTreeOp* asg,
if ((gsShadowVarInfo != nullptr) && lvaGetDesc(lclNum)->lvIsParam &&
(gsShadowVarInfo[lclNum].shadowCopy != BAD_VAR_NUM))
{
assert(!curSsaName->Lookup(lclNum));
return;
}

Expand All @@ -308,9 +309,11 @@ void Compiler::optCopyPropPushDef(GenTreeOp* asg,
else
{
assert((lclNode->gtFlags & GTF_VAR_DEF) != 0);
ssaDefNum = GetSsaNumForLocalVarDef(lclNode);

// This will be "RESERVED_SSA_NUM" for promoted struct fields assigned using the parent struct.
// TODO-CQ: fix this.
ssaDefNum = GetSsaNumForLocalVarDef(lclNode);
assert((ssaDefNum != SsaConfig::RESERVED_SSA_NUM) || lvaGetDesc(lclNode)->CanBeReplacedWithItsField(this));
}

// The default is "not available".
Expand Down

0 comments on commit a552f20

Please sign in to comment.