JIT: Allow liveness to remove some nodes with contained side effects#116819
Merged
jakobbotsch merged 1 commit intodotnet:mainfrom Jun 23, 2025
Merged
JIT: Allow liveness to remove some nodes with contained side effects#116819jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch merged 1 commit intodotnet:mainfrom
Conversation
Contained operands with side effects can usually be handled by clearing their containment status. This is what we did before 3091730 which changed the DCE to skip nodes with contained side effects. However, the only case that does not support its own standalone codegen is currently embedded mask ops, so switch to check more specifically for this case. This fixes a case where after removing a call node we could end up with a unused `FIELD_LIST` with a contained IND node, and also fixes the regressions seen because of 3091730.
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
a74nh
reviewed
Jun 20, 2025
| // Only embedded mask ops do not support standalone codegen. All other | ||
| // nodes can be uncontained. | ||
| // | ||
| bool Compiler::fgCanUncontainOrRemoveOperands(GenTree* node) |
Contributor
There was a problem hiding this comment.
I'm happy that this won't break anything I was fixing.
Member
Author
|
PTAL @dotnet/jit-contrib Minor diffs. Essentially just undoing the regressions from #116144 |
amanasifkhalid
approved these changes
Jun 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contained operands with side effects can usually be handled by clearing their containment status. This is what we did before #116144 which changed the DCE to skip nodes with contained side effects. However, the only case that does not support its own standalone codegen is currently embedded mask ops, so switch to check more specifically for this case.
This fixes a case where after removing a call node we could end up with a unused
FIELD_LISTwith a contained IND node, and also fixes the regressions seen because of #116144.Also switches
GenTree::VisitOperandsto return the visit result, and switchesNodeOrContainedOperandsMayThrow()to use it (it is slightly more efficient than the iterator version).Most ideally we would just allow these embedded mask ops to work as top-level nodes, like all other containment candidates.
Fix #116814