Jit: run throw helper merge phase before morph (#35255)
authorAndy Ayers <andya@microsoft.com>
Thu, 23 Apr 2020 21:48:16 +0000 (14:48 -0700)
committerGitHub <noreply@github.com>
Thu, 23 Apr 2020 21:48:16 +0000 (14:48 -0700)
commitb8283098f698bf844299f8ca817a3b1c497c724c
tree976880bfe1c1783689342bf3a04db6eecac980ce
parent19d26fc6c30c70c476e0a37b75e8d7180e9bcd4b
Jit: run throw helper merge phase before morph (#35255)

Now that we have pred lists before morph, we can move the throw helper
tail merge phase earlier in the phase list.

This has two benefits:
* we can now merge a few more cases, because morph can introduce unique
temps for otherwise identical calls;
* it saves some throughput, because we no longer need to morph duplicate
calls.

There is more opportunity here to reduce code size if we can find the right
heuristic in morph to decide if throw helpers should be called or tail-called,
though the overall benefit is small (~600 methods, ~2000k bytes). I left the
current heuristic in place as I couldn't come up with anything better.

Fixes #35135.
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/morph.cpp