Stop using LIST nodes for PHI operand lists (dotnet/coreclr#20266)
authormikedn <onemihaid@hotmail.com>
Tue, 27 Aug 2019 21:28:43 +0000 (00:28 +0300)
committerCarol Eidt <carol.eidt@microsoft.com>
Tue, 27 Aug 2019 21:28:43 +0000 (14:28 -0700)
commite0c201c9487d7bb82db8ba7f64ce65409873a490
tree0642468eb5ffb9bacfe91d30a3f26afbe602713a
parentc318e1538ef2d4d0532ee329bb045eb3222bcd67
Stop using LIST nodes for PHI operand lists (dotnet/coreclr#20266)

* Stop using LIST nodes for PHI operand lists

* Speed up PHI creation

Calling gtSetStmtInfo/fgSetStmtSeq every time an arg is added is rather expensive and not really needed. Costs are always 0 and the shape of the PHI tree is always the same.

Removal of GT_LIST nodes makes it easier to update the linear order incrementally when a GT_PHI_ARG node is added.

* Cleanup PHI value numbering

This replaces the manual traversal of PHI's list of uses with a range-based for loop and cleans up a bunch of convoluted code.

* Remove redundant AsPhi

* Remove list pointer union

* Update PHI equality check

* Add GenTreePhi comment

* Rename op to node

Commit migrated from https://github.com/dotnet/coreclr/commit/501c1e3629bbe89cbcec2ee8057ec111a88bdbc8
16 files changed:
src/coreclr/src/jit/assertionprop.cpp
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/compiler.hpp
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/gtlist.h
src/coreclr/src/jit/gtstructs.h
src/coreclr/src/jit/morph.cpp
src/coreclr/src/jit/optimizer.cpp
src/coreclr/src/jit/rangecheck.cpp
src/coreclr/src/jit/rationalize.cpp
src/coreclr/src/jit/ssabuilder.cpp
src/coreclr/src/jit/ssabuilder.h
src/coreclr/src/jit/valuenum.cpp