From: Joseph Tremoulet Date: Tue, 20 Dec 2016 18:23:58 +0000 (-0800) Subject: Use field type value-numbering local field stores X-Git-Tag: submit/tizen/20210909.063632~11030^2~8575^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6c5dc7ea3aa88e261b3c097fad358144281f6b8;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Use field type value-numbering local field stores Method `VNPairApplySelectorsAssign` takes the type of the value being assigned, so when processing a store to a field of a local struct, pass the type of the field rather than the type of the local; failure to do so was blocking propagation of the value number to subsequent loads of the same field due to the type mismatch. Commit migrated from https://github.com/dotnet/coreclr/commit/ae3f036d1527dddc399a15da6151661143e2948a --- diff --git a/src/coreclr/src/jit/valuenum.cpp b/src/coreclr/src/jit/valuenum.cpp index c67611f..f7cc0c9 100644 --- a/src/coreclr/src/jit/valuenum.cpp +++ b/src/coreclr/src/jit/valuenum.cpp @@ -5640,10 +5640,9 @@ void Compiler::fgValueNumberTree(GenTreePtr tree, bool evalAsgLhsInd) // (we looked in a side table above for its "def" identity). Look up that value. ValueNumPair oldLhsVNPair = lvaTable[lclFld->GetLclNum()].GetPerSsaData(lclFld->GetSsaNum())->m_vnPair; - newLhsVNPair = - vnStore->VNPairApplySelectorsAssign(oldLhsVNPair, lclFld->gtFieldSeq, - rhsVNPair, // Pre-value. - lvaGetActualType(lclFld->gtLclNum), compCurBB); + newLhsVNPair = vnStore->VNPairApplySelectorsAssign(oldLhsVNPair, lclFld->gtFieldSeq, + rhsVNPair, // Pre-value. + lclFld->TypeGet(), compCurBB); } } lvaTable[lclFld->GetLclNum()].GetPerSsaData(lclDefSsaNum)->m_vnPair = newLhsVNPair;