-
Notifications
You must be signed in to change notification settings - Fork 5.3k
JIT: Null out SSA def nodes upon removal in RBO #108530
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
Conversation
| assert(candidateStmt->GetRootNode()->OperIs(GT_STORE_LCL_VAR)); | ||
| GenTreeLclVarCommon* const rootNode = candidateStmt->GetRootNode()->AsLclVarCommon(); | ||
|
|
||
| LclVarDsc* const varDsc = lvaGetDesc(rootNode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the local is in SSA you should be able to locate the LclSsaVarDsc directly. Something like:
unsigned const ssaNum = rootNode->GetSsaNum();
LclSsaVarDsc* const defDsc = varDsc->GetPerSsaData(ssaNum);
assert(defDsc->GetDefNode() == rootNode);
defDsc->SetDefNode(nullptr);There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
|
/backport to release/9.0 |
|
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/11182189273 |
Fixes #108406. When removing redundant store nodes in RBO, we need to also update SSA definitions to no longer track the removed stores. Because call sites that use SSA definitions are responsible for null-checking the store node, the simplest method of removal is to null out the node pointer in the SSA def.
cc @dotnet/jit-contrib, @AndyAyersMS PTAL. I can include a regression test if you think it would be useful, but I think the new
DEBUG_DESTROY_NODEgives us better coverage anyway.