JIT: fix another case of early flow graph divergence (#85873)
authorAndy Ayers <andya@microsoft.com>
Sun, 7 May 2023 01:22:31 +0000 (18:22 -0700)
committerGitHub <noreply@github.com>
Sun, 7 May 2023 01:22:31 +0000 (18:22 -0700)
commitd7c94a8b5e29aa8f83981476b95c61ce313f6a72
treec3c146538716a5211cbd9771444a9333b4e786c1
parent3b88700e47e534c943fbfe4cbad9547b99c3e0ad
JIT: fix another case of early flow graph divergence (#85873)

The JIT will sometimes decide to instrument a Tier0 method even if `BBINSTR`
is not passed by the VM (this is enabled when the VM passes `BBINSTR_IF_LOOPS`
so that we can provide some PGO data to OSR methods).

In such cases we build the flow graph and then decide to instrument, so the
flow graph shape may differ from the case where we know up front that we are going
to instrument or optimize.

Remedy this by also running the early branch to next flow graph opt when a Tier0
JIT is passed `BBINSTR_IF_LOOPS`.

Addresses another case of #85856.
src/coreclr/jit/compiler.h
src/coreclr/jit/fgbasic.cpp
src/coreclr/jit/importer.cpp