diff options
author | Brian Sullivan <briansul@microsoft.com> | 2018-12-12 14:42:43 -0800 |
---|---|---|
committer | Brian Sullivan <briansul@microsoft.com> | 2018-12-12 14:42:43 -0800 |
commit | d80bbeebc88117f3c2e696a1f4fcfeb844c02557 (patch) | |
tree | 8b71dcc337b94cfbf35952216e18a19016431895 /src/jit/valuenum.cpp | |
parent | 842f575fac8d64467bb4a15ef9fe893bedc536ad (diff) | |
download | coreclr-d80bbeebc88117f3c2e696a1f4fcfeb844c02557.tar.gz coreclr-d80bbeebc88117f3c2e696a1f4fcfeb844c02557.tar.bz2 coreclr-d80bbeebc88117f3c2e696a1f4fcfeb844c02557.zip |
Fix for PMI assert: 'vnWx != NoVN'
Diffstat (limited to 'src/jit/valuenum.cpp')
-rw-r--r-- | src/jit/valuenum.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/jit/valuenum.cpp b/src/jit/valuenum.cpp index 852cd65d55..0ea6df9bc9 100644 --- a/src/jit/valuenum.cpp +++ b/src/jit/valuenum.cpp @@ -6777,29 +6777,33 @@ void Compiler::fgValueNumberBlockAssignment(GenTree* tree) JITDUMP(" *** Missing field sequence info for Dst/LHS of COPYBLK\n"); isNewUniq = true; } - else if (lhsFldSeq != nullptr && isEntire) - { - // This can occur for structs with one field, itself of a struct type. - // We are assigning the one field and it is also the entire enclosing struct. - // - // Use an unique value number for the old map, as this is an an entire assignment - // and we won't have any other values in the map - ValueNumPair oldMap; - oldMap.SetBoth(vnStore->VNForExpr(compCurBB, lclVarTree->TypeGet())); - rhsVNPair = vnStore->VNPairApplySelectorsAssign(oldMap, lhsFldSeq, rhsVNPair, lclVarTree->TypeGet(), - compCurBB); - } - else if (!isNewUniq) - { - ValueNumPair oldLhsVNPair = lvaTable[lhsLclNum].GetPerSsaData(lclVarTree->GetSsaNum())->m_vnPair; - rhsVNPair = vnStore->VNPairApplySelectorsAssign(oldLhsVNPair, lhsFldSeq, rhsVNPair, - lclVarTree->TypeGet(), compCurBB); - } if (isNewUniq) { rhsVNPair.SetBoth(vnStore->VNForExpr(compCurBB, lclVarTree->TypeGet())); } + else // We will assign rhsVNPair into a map[lhsFldSeq] + { + if (lhsFldSeq != nullptr && isEntire) + { + // This can occur for structs with one field, itself of a struct type. + // We are assigning the one field and it is also the entire enclosing struct. + // + // Use an unique value number for the old map, as this is an an entire assignment + // and we won't have any other values in the map + ValueNumPair uniqueMap; + uniqueMap.SetBoth(vnStore->VNForExpr(compCurBB, lclVarTree->TypeGet())); + rhsVNPair = vnStore->VNPairApplySelectorsAssign(uniqueMap, lhsFldSeq, rhsVNPair, + lclVarTree->TypeGet(), compCurBB); + } + else + { + ValueNumPair oldLhsVNPair = + lvaTable[lhsLclNum].GetPerSsaData(lclVarTree->GetSsaNum())->m_vnPair; + rhsVNPair = vnStore->VNPairApplySelectorsAssign(oldLhsVNPair, lhsFldSeq, rhsVNPair, + lclVarTree->TypeGet(), compCurBB); + } + } lvaTable[lhsLclNum].GetPerSsaData(lclDefSsaNum)->m_vnPair = vnStore->VNPNormalPair(rhsVNPair); @@ -6883,7 +6887,6 @@ void Compiler::fgValueNumberTree(GenTree* tree) switch (oper) { case GT_LCL_VAR: - case GT_REG_VAR: { GenTreeLclVarCommon* lcl = tree->AsLclVarCommon(); unsigned lclNum = lcl->gtLclNum; @@ -7252,7 +7255,6 @@ void Compiler::fgValueNumberTree(GenTree* tree) switch (lhs->OperGet()) { case GT_LCL_VAR: - case GT_REG_VAR: { GenTreeLclVarCommon* lcl = lhs->AsLclVarCommon(); unsigned lclDefSsaNum = GetSsaNumForLocalVarDef(lcl); |