JIT: PGO: fgOptimizeUncondBranchToSimpleCond corrupts profile data #50419
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
in-pr
There is an active PR which will close this issue when it is merged
tenet-performance
Performance related issue
Milestone
It looks like
fgOptimizeUncondBranchToSimpleCond
(as part of theOptimize Layouts
phase) produces invalid weights in some cases. E.g.Before
Optimize layout
:^ all edges look valid and satisfy Kirchhoff's Law.
After
Optimize Layouts
:^
invalid edges:
BB06 (in: 0 + 0.5, out: 1)
BB09 (in: 0.25, out: 0)
I guess invalid edges are fine and will be re-calculated, but there are also invalid blocks such as BB09 which is a predecessor of a cold block but has weight 0.5 (BB05 should also be cold then?)
As the result, in the end I have:
But if I disable
fgOptimizeUncondBranchToSimpleCond
the final weights will be reported as valid:^ "After Optimize Layout" without
fgOptimizeUncondBranchToSimpleCond
, all blocks look valid again (edges aren't though)./cc @AndyAyersMS
category:correctness
theme:profile-feedback
skill-level:beginner
cost:small
impact:small
The text was updated successfully, but these errors were encountered: