summaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorJoseph Tremoulet <jotrem@microsoft.com>2016-12-20 10:23:58 -0800
committerJoseph Tremoulet <jotrem@microsoft.com>2016-12-20 10:23:58 -0800
commitae3f036d1527dddc399a15da6151661143e2948a (patch)
tree0fe97dc295b664050e5764ac065673da70e6ddd2 /src/jit
parentd23b78ce50d04e97cc23f997fab8c0ce5faa8726 (diff)
downloadcoreclr-ae3f036d1527dddc399a15da6151661143e2948a.tar.gz
coreclr-ae3f036d1527dddc399a15da6151661143e2948a.tar.bz2
coreclr-ae3f036d1527dddc399a15da6151661143e2948a.zip
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.
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/valuenum.cpp7
1 files changed, 3 insertions, 4 deletions
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;