Improve fgAddRefPred (dotnet/coreclr#12585)
authorBruce Forstall <brucefo@microsoft.com>
Sat, 1 Jul 2017 06:04:14 +0000 (23:04 -0700)
committerGitHub <noreply@github.com>
Sat, 1 Jul 2017 06:04:14 +0000 (23:04 -0700)
commit30e36c89b3defbf2e4f212456dc0d33406574262
tree60e1c5fdd079fd9a0e6350a49b29a472d4b9699d
parent4f6a02ada74a48122ffbcf1528a38db3c3b84866
Improve fgAddRefPred (dotnet/coreclr#12585)

* Improve fgAddRefPred

Only do one search through the predecessor list looking for an
existing predecessor edge, or looking for the proper location to
insert a new predecessor edge. Previously, we traversed the list
twice (or part of twice) for new edges. For new edges, stop the
search when we reach the correct location in sorted order.

This reduces x86 release minopts instruction count by 0.42% and
full opts instruction count by 0.33% (of a superpmi replay of
the tests).

Fixes dotnet/coreclr#12582

* Update for feedback

Commit migrated from https://github.com/dotnet/coreclr/commit/58d0ead6d34837fab60da1473090588db415fc1d
src/coreclr/src/jit/flowgraph.cpp