Improve narrowing of GT_AND nodes. (dotnet/coreclr#18916)
authorEugene Rozenfeld <erozen@microsoft.com>
Mon, 16 Jul 2018 18:24:54 +0000 (11:24 -0700)
committerGitHub <noreply@github.com>
Mon, 16 Jul 2018 18:24:54 +0000 (11:24 -0700)
commit76c556a55fae956ae8537fd347caf8595329abe4
treee637222cd55ccb4c59863444619c7bfbaac33b49
parent0cf317efbee52dd2aa3305708576c47bd6fbce90
Improve narrowing of GT_AND nodes. (dotnet/coreclr#18916)

This is a follow-up to to dotnet/coreclr#18816 which resulted in a 6 byte regression in one of the
desktop SuperPMI methods. This change removes that regression and adds a number
of improved diffs.

If we are narrowing GT_AND to an unsigned type and one of the operands can be narrowed
into that type, the result of the GT_AND will also fit into that type and can be narrowed.
The same is true if one of the operands is an int const and can be narrowed into 'dsst'.

The change also ensures that we don't call optNarrowTree(false) more than once on each of the
GT_AND operands.

Commit migrated from https://github.com/dotnet/coreclr/commit/c0bad3c66218f61dd3e4f151b9d2eae22c6d88d2
src/coreclr/src/jit/optimizer.cpp