Refactor isContained().
authorPat Gavlin <pagavlin@microsoft.com>
Fri, 24 Feb 2017 19:19:27 +0000 (11:19 -0800)
committerPat Gavlin <pagavlin@microsoft.com>
Sat, 25 Feb 2017 17:55:03 +0000 (09:55 -0800)
commit4a321aa3b05f89f607d0a07aeb98edcc183f73f4
tree213f312ad4a4ce7d72ab5b14155f53cd4a02a408
parentbbe70b4f5941063594b9c34545df6fd89db1aeba
Refactor isContained().

This changes isContained to terminate early if it is not possible for the node in question
to ever be contained. There are many nodes that are statically non-containable: any node
that is not a value may not be contained along with a small number of value nodes. To avoid
the need for a `switch` to identify the latter, their node kinds have been marked with a
new flag, `GTK_NOCONTAIN`. The checks for identifying non-containable nodes are encapsulated
withing a new function, `canBeContained`.

Commit migrated from https://github.com/dotnet/coreclr/commit/350020d9b6a2bda08cf2e416d959c1801a717734
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/gtlist.h
src/coreclr/src/jit/lower.cpp