-
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
Diff in checked vs. release #98772
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsCall to runtime/src/coreclr/jit/fgflow.cpp Lines 627 to 630 in 703f6e8
In Debug, Mostly caused by #98526
|
Fixes #98772. Recently, we started checking successor edge likelihoods in Compiler::fgDebugCheckProfileWeights by default; this means we call Compiler::fgDebugCheckOutgoingProfileData in Debug/Checked builds to verify successor edges' likelihoods, and thus call BasicBlock::GetSucc(unsigned, Compiler*) to iterate the successor edges. For switch blocks, GetSucc(unsigned, Compiler*) calls GetSwitchDescMap, and builds m_switchDescMap if it doesn't exist yet. Upon finishing edge likelihood verification, we don't reset m_switchDescMap, so it is possible for this map to be created earlier in Debug/Checked builds versus Release builds. This doesn't result in behavioral diffs if the map contains the same state between Debug/Release builds by the time it is read. However, if the map is null by the time it is needed, it is created on-demand, ensuring it is completely up-to-date. If the map is not null, the correctness of its current state depends on how judiciously it was maintained with UpdateSwitchTableTarget, creating potential for diffs in the map's state. By invalidating the map instead of updating it as state changes, we can force it to be rebuilt with the latest state when it's needed.
Call to
GetSwitchDescMap()
that createsm_switchDescMap
if it is nullptr.m_switchDescMap
is invalidated everytime we renumber blocks or we replace jump targets. However, if I trace the caller ofGetSwitchDescMap()
, I see that it can get called from DEBUG viafgDebugCheckProfileWeights()
and repopulate the map, which will behave differently at later point of time when weUpdateSwitchTableTarget()
.runtime/src/coreclr/jit/fgflow.cpp
Lines 627 to 630 in 703f6e8
In Debug,
map != nullptr
and hence we update the target, but in Release, it is still nullptr. In Debug, since we updated the target, it changes the successors we visit and variables created, offsets they get assigned to, etc.Mostly caused by #98526
The text was updated successfully, but these errors were encountered: