Fix assertion regarding byteable xor reg,reg when ngen'ing desktop mscorlib
authorBruce Forstall <brucefo@microsoft.com>
Tue, 11 Oct 2016 01:10:16 +0000 (18:10 -0700)
committerBruce Forstall <brucefo@microsoft.com>
Wed, 12 Oct 2016 15:13:52 +0000 (08:13 -0700)
commitd4a1e2eb13e39cc33b235792e13761b8c8650147
treebf797082139a561fcbc5ca6422a2681898eb93b8
parent249e05c21b2eb6deaac5814d6aa8fa851276b040
Fix assertion regarding byteable xor reg,reg when ngen'ing desktop mscorlib

Fixes dotnet/coreclr#7483

The issue is that TreeNodeInfoInitCmp() will, under certain circumstances,
perform a tree transformation of a child node into a TYP_UBYTE type. Since
the TreeNodeInfo walk is bottom-up, its children have already been processed,
and they don't get the "byteable" register processing that is as the end of
TreeNodeInfoInit().

I extracted that processing into a TreeNodeInfoInitCheckByteable() function that
can be called after the TreeNodeInfoInitCmp() transformation.

A better solution might be to extract this, and other, tree transformations into
the prior "lowering" pass, such that TreeNodeInfoInit() and friends will only
do register requirement annotation. But that would be considerably more complicated,
so I opted not to do that for now.

I also fixed up a bunch of comments.

Commit migrated from https://github.com/dotnet/coreclr/commit/c30b1a022d8ce297900120998ec655b748d72cce
src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/lower.h
src/coreclr/src/jit/lowerxarch.cpp