summaryrefslogtreecommitdiff
path: root/src/jit/valuenum.cpp
diff options
context:
space:
mode:
authorMike Danes <onemihaid@hotmail.com>2017-11-13 22:36:50 +0200
committerMike Danes <onemihaid@hotmail.com>2018-07-19 07:29:44 +0300
commit72a1d0ee7c9f5989edc9f449df24b5b87a5844ce (patch)
treed0ee59011a0f538a9a129289c7285fadc4d51fd0 /src/jit/valuenum.cpp
parent624f72d55a92e49aef3c3cd6e69150fa3b085fac (diff)
downloadcoreclr-72a1d0ee7c9f5989edc9f449df24b5b87a5844ce.tar.gz
coreclr-72a1d0ee7c9f5989edc9f449df24b5b87a5844ce.tar.bz2
coreclr-72a1d0ee7c9f5989edc9f449df24b5b87a5844ce.zip
Eliminate duplicate SSA number bookkeeping
During SSA construction SsaRenameState keeps a definition count for each variable in an array. But each variable has a lvPerSsaData array that does almost the same thing, count the definitions. "Almost" because lvPerSsaData is a JitExpandArray that tracks only the array size and not the number of elements actually stored in the array. Replace JitExpandArray with purposely designed "array" that is in charge with allocating new SSA numbers and handles their intricacies - RESERVED_SSA_NUM, UNINIT_SSA_NUM and FIRST_SSA_NUM. This also allows the removal of the allocator from the array. Allocating new SSA numbers happens only during SSA construction and it's reasonable to pass the allocator to AllocSsaNum rather than increasing the size of PerSsaArray and LclVarDsc.
Diffstat (limited to 'src/jit/valuenum.cpp')
-rw-r--r--src/jit/valuenum.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jit/valuenum.cpp b/src/jit/valuenum.cpp
index a65a8787f0..ac1769fea9 100644
--- a/src/jit/valuenum.cpp
+++ b/src/jit/valuenum.cpp
@@ -4545,9 +4545,9 @@ void Compiler::fgValueNumber()
{
ValueNumPair noVnp;
// Make sure the memory SSA names have no value numbers.
- for (unsigned i = 0; i < lvMemoryNumSsaNames; i++)
+ for (unsigned i = 0; i < lvMemoryPerSsaData.GetCount(); i++)
{
- lvMemoryPerSsaData.GetRef(i).m_vnPair = noVnp;
+ lvMemoryPerSsaData.GetSsaDefByIndex(i)->m_vnPair = noVnp;
}
for (BasicBlock* blk = fgFirstBB; blk != nullptr; blk = blk->bbNext)
{