Introduce `MemoryKind` abstraction
authorJoseph Tremoulet <jotrem@microsoft.com>
Thu, 29 Dec 2016 22:02:18 +0000 (17:02 -0500)
committerJoseph Tremoulet <jotrem@microsoft.com>
Wed, 8 Feb 2017 14:32:46 +0000 (09:32 -0500)
commit0076a41b5dfb196c444c99821bb5b5ea76648fc4
tree5e4c8acca7eaf5d2d6b0bcfc1e9ea912859944ec
parent33bd22b3e82b3e207a2e078c51c03a8f215ba8b1
Introduce `MemoryKind` abstraction

Re-cast the notion of "heap" (in liveness, SSA, and value-numbering) as
one of potentially many `MemoryKind`s, called `GcHeap`.  Update names,
comments, data structures, and signatures as appropriate to parameterize
relevant data/methods over `MemoryKind`.  This change is a no-diff
refactoring, and currently `GcHeap` is the only `MemoryKind`.  Generally,
codepaths which will generically need to process all `MemoryKinds`s
(initializing, dumping, dataflow propagation) now iterate over all
`MemoryKinds`, and codepaths which are sensitive to the semantics of the
specific `MemoryKind` (def/use identification in liveness and value
numbering) are changed to specifically operate on `MemoryKind::GcHeap`.

One notable exception is that `lvMemoryPerSsaData` and `CountForMemoryDef`
are *not* parameterized over `MemoryKind`; there's a single "space" of SSA
defnums for memory defs (though the same tree can incur different defs for
different memory kinds [in which case their defnums will differ]), to
facilitate subsequently sharing SSA nodes across memory kinds when
appropriate.

Commit migrated from https://github.com/dotnet/coreclr/commit/463502f9e70e39cd460091298b338a065b8631f2
18 files changed:
src/coreclr/src/jit/block.cpp
src/coreclr/src/jit/block.h
src/coreclr/src/jit/codegenlegacy.cpp
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/compiler.hpp
src/coreclr/src/jit/compmemkind.h
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/liveness.cpp
src/coreclr/src/jit/optimizer.cpp
src/coreclr/src/jit/ssabuilder.cpp
src/coreclr/src/jit/ssabuilder.h
src/coreclr/src/jit/ssarenamestate.cpp
src/coreclr/src/jit/ssarenamestate.h
src/coreclr/src/jit/valuenum.cpp
src/coreclr/src/jit/valuenum.h
src/coreclr/src/jit/valuenumfuncs.h
src/coreclr/src/jit/valuenumtype.h