-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: fgRemoveBlock
does not maintain edge weights
#96614
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsThis code drops the old edge and weight on it: runtime/src/coreclr/jit/fgbasic.cpp Line 5375 in 21b4a85
If we have blocks BB02 [0085] 2 BB01,BB36 1 211 0 [???..???)-> BB13 ( cond ) IBC internal Loop loopheader
BB03 [0087] 1 BB02 0.42 88 0 [01D..???)-> BB04 (always) IBC internal LoopPH q
BB04 [0002] 2 BB03,BB12 0.55 117 1 [01D..02D)-> BB41 ( cond ) i IBC Loop bwd bwd-target loopheader
...
Setting edge weights for BB02 -> BB03 to [88.48387 .. 88.48387]
...
fgRemoveBlock BB03, unreachable=false
Removing empty BB03
Setting edge weights for BB02 -> BB04 to [0 .. 117] // not the right weight When removing There's probably a ton of these in the JIT, but I figured I would open an issue since I saw it be the cause of diffs. (Also, maybe the fact that
|
Not sure we can do much here just yet, since either the incoming profile is already consistent (which we can locally check) and so no adjustment should be needed, or else we're making it inconsistent which likely indicates a problem elsewhere. Once we have consistency checking enabled deeper into the jit we should run across and fix those elsewhere cases and can add a suitable assert here. |
Going to move this out of 9.0, since it depends on other work that is now opportunistic. |
Going to close this given Andy's comments above, since this should be naturally caught and resolved as consistency checking gets enabled for more and more phases. |
This code drops the old edge and weight on it:
runtime/src/coreclr/jit/fgbasic.cpp
Line 5375 in 21b4a85
If we have blocks
A -> B -> C
, with an emptyB
, then we should end up with the same result whether we compactB
intoC
or whether we just removeB
. However, currently we drop theA -> B
weight if we removeB
:When removing
B
, should the weight onA -> C
be inherited fromA -> B
?There's probably a ton of these in the JIT, but I figured I would open an issue since I saw it be the cause of diffs. (Also, maybe the fact that
B -> C
is not already the same asA -> B
is a problem in maintenance in and of itself, so maybe the issue exists elsewhere.)out_base.txt (jitdump with
fgRemoveBlock
)out.txt (jitdump with compaction)
The text was updated successfully, but these errors were encountered: