JIT: start working on profile consistency (#81936)
authorAndy Ayers <andya@microsoft.com>
Mon, 13 Feb 2023 19:49:29 +0000 (11:49 -0800)
committerGitHub <noreply@github.com>
Mon, 13 Feb 2023 19:49:29 +0000 (11:49 -0800)
commitf857468fd9ae571ca78ee0f22915e2489404541a
treeb3256b8f116937c1d24c40f3667c9c5626401531
parent6f36be56480dc0a24a9713df5d81875a9ca2c980
JIT: start working on profile consistency (#81936)

Dump flow graph before running post-phase checks so the flow graph
visualization can be used in conjunction with the profile checker output
to spot profile problems.

Various provisional fixes to try and shore up the inevitably inconsistent
OSR profile. Add a compensating pseudo-edges to the OSR entry to help
explain where the missing flow counts have gone. Relax checking for
the OSR entry. Add likelhood when we redirect flow to the OSR entry.
Locate the OSR entry and original method entry early so we can
special-case them in diagnostics.

Defer marking interesting blocks (say for switch peeling) until we've
set edge likelihoods, since (someday) those decisions should use edge
likelihoods.

Disable profile checking after profile incorporation. The plan is to
walk this disable back incrementally and fix issues in each succesive
phase, ultimately checking them all. But currently we still have a lot
of check failures right after this first phase.

Contributes to #46885.
src/coreclr/jit/compiler.cpp
src/coreclr/jit/fgbasic.cpp
src/coreclr/jit/fgprofile.cpp
src/coreclr/jit/optimizer.cpp
src/coreclr/jit/phase.cpp