From ae3f036d1527dddc399a15da6151661143e2948a Mon Sep 17 00:00:00 2001 From: Joseph Tremoulet Date: Tue, 20 Dec 2016 10:23:58 -0800 Subject: 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. --- src/jit/valuenum.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/jit/valuenum.cpp b/src/jit/valuenum.cpp index c67611f690..f7cc0c9a23 100644 --- a/src/jit/valuenum.cpp +++ b/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; -- cgit v1.2.3