Define `MemoryKind::ByrefExposed`
authorJoseph Tremoulet <jotrem@microsoft.com>
Wed, 11 Jan 2017 19:58:57 +0000 (14:58 -0500)
committerJoseph Tremoulet <jotrem@microsoft.com>
Wed, 8 Feb 2017 14:32:46 +0000 (09:32 -0500)
commitd7c952dba010257db1b29f3b111f131e4d8ccb35
treeab250293bf4f885d7c97e964f9e5ad495aea45ac
parent0076a41b5dfb196c444c99821bb5b5ea76648fc4
Define `MemoryKind::ByrefExposed`

Add a new `MemoryKind` to represent "any memory that byrefs may
reference", called `ByrefExposed`.  All definition points of `GcHeap`
become also definition points of `ByrefExposed`, and additionally, so do
definitions of address-exposed locals.

Because it is a common case (currently happening in 90% of methods in
System.Private.CoreLib) that a method has no definitions of
address-exposed locals, have liveness detect this condition and set the
new `byrefStatesMatchGcHeapStates` flag accordingly; when the states
match, the same `MemoryPhi`s, defnums, and `PerSsaData` are then shared
between the two memory kinds, to avoid excess allocations/processing.

This change defines `ByrefExposed` memory and its def/use points, and
builds SSA for it, but no optimizations make use of it, so this is a
no-diff change.

Commit migrated from https://github.com/dotnet/coreclr/commit/1c6a419710ed292f2fa48e459239ee95e3ed2ca2
src/coreclr/src/jit/block.h
src/coreclr/src/jit/codegenlegacy.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/liveness.cpp
src/coreclr/src/jit/optimizer.cpp
src/coreclr/src/jit/ssabuilder.cpp
src/coreclr/src/jit/ssarenamestate.cpp
src/coreclr/src/jit/ssarenamestate.h
src/coreclr/src/jit/valuenum.cpp