JIT: profile synthesis consistency checking and more (#83068)
authorAndy Ayers <andya@microsoft.com>
Tue, 7 Mar 2023 16:31:45 +0000 (08:31 -0800)
committerGitHub <noreply@github.com>
Tue, 7 Mar 2023 16:31:45 +0000 (08:31 -0800)
commit168a72ec05214f0378bf5eb9a45029c674a9ca22
tree1aefc240b9666fc1832a97c0192e9e70b68996ce
parentb6fc7bd436aec850f37d0330f07126cfe1ad5fec
JIT: profile synthesis consistency checking and more (#83068)

Add the ability to verify that the profile counts produced by synthesis are
self-consistent, and optionally to assert if they're not. Disable checking
if we know profile flow will be inconsistent (because of irreducible loops
and/or capped cyclic probabilities).

Consistently ignore the likely flow out of handlers. Generally we model
handlers as isolated subgraphs that do not contribute flow to the main flow
graph. This is generally acceptable.

The one caveat is for flow into finallies. The plan here is to fix the weights
for finallies up in a subsequent pass via simple scaling once callfinallies
are introduced. Flow weights out of finallies will be ignored as the
callfinally block will be modeled as always flowing to its pair tail.

Also add the ability to propagate the synthesized counts into the live profile
data. This is mainly to facilitate using the MIBC comparison tools we have
to assess how closely the synthesiszed data comes to actual PGO data.

Finally, enable the new synthesized plus checked modes in a few of our PGO
pipelines.

Contributes to #82964.
eng/pipelines/common/templates/runtimes/run-test-job.yml
eng/pipelines/libraries/run-test-job.yml
src/coreclr/jit/compiler.h
src/coreclr/jit/fgdiagnostic.cpp
src/coreclr/jit/fgprofile.cpp
src/coreclr/jit/fgprofilesynthesis.cpp
src/coreclr/jit/fgprofilesynthesis.h
src/coreclr/jit/jitconfigvalues.h
src/coreclr/jit/optimizer.cpp
src/tests/Common/testenvironment.proj