JIT: fix some asserts in profile incorporation and reconstruction (#82196)
authorAndy Ayers <andya@microsoft.com>
Thu, 16 Feb 2023 18:54:00 +0000 (10:54 -0800)
committerGitHub <noreply@github.com>
Thu, 16 Feb 2023 18:54:00 +0000 (10:54 -0800)
commit4d0ddc1a84d97a0c94a9f03e3497828cb19597b3
tree81a927bdf2770b0e417147cae59c45f701373db7
parent4e0ff826321d6748ebd31ed24eb61a01b2354bd0
JIT: fix some asserts in profile incorporation and reconstruction (#82196)

If we're instrumenting a Tier0 method with partial compilation enabled, we may
see divergence between the instrumentation plan phase (which runs before
importation) and the instrumentation phase (which runs after), because the
importer may have altered flow at partial compilation points. Tolerate this.

If we're instrumenting a Tier1 OSR method whose first block is a self-loop,
we may not see a pseudo-edge from the OSR entry to the method's first block
in the profile reconstruction model, because they are the same block.
Tolerate this.

Fixes #82128.
src/coreclr/jit/fgprofile.cpp