-
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
optRemoveRedundantZeroInits
doesn't know about some safe points
#102577
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
probably explains #101890 |
It might also be nice to not rely on If this optimization is done at a stage when everything that needs to be a call is already a call, it could be more precise about "No-GC" cases. |
Do we have a similar problem with casts that end up calling managed helpers or they are already calls at the time when this optimization runs? |
My understanding that we rely on liveness phase to drop the redundant zeroings so doing this in a late phase won't be that useful |
I think they're always calls, aren't they? I mean they might be expanded, but they can't be collapsed back to calls |
I am just not that familiar with how JIT handles them - whether they are always calls or there are cast operators in the tree that later are lowered into calls. |
Ah, you meant GT_CAST probably (to cast primitives). Let me check, maybe we might lower it into a call on some 32bit targets or/and in checked context. |
Most things end up as either calls or The cases that suffer from this issue are only those recent lowering additions where previously always-no-GC nodes get turned into potentially-GC helpers. |
Looking at #102531, I realized the logic will miss implicit safe points created by the somewhat recent block store lowering changes.
Reproduction:
DOTNET_TieredCompilation=0
,DOTNET_GCStress=0xC
,DOTNET_ReadyToRun=0
(it looks like GC stress doesn't apply to precompiled code).Expected result: nothing happens.
Actual result:
Cause:
optRemoveRedundantZeroInits
doesn't know that the block copy may become a safe point. Zero-init and future calls introduced late suffer from the same problem.The most robust fix for this would probably be to move
optRemoveRedundantZeroInits
later (make it part of late liveness, say).The text was updated successfully, but these errors were encountered: