-
Notifications
You must be signed in to change notification settings - Fork 5k
Fix flags in EarlyProp after nullcheck is removed #112717
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
/azp run runtime-coreclr jitstress-random |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- src/coreclr/jit/earlyprop.cpp: Language not supported
PTAL @jakobbotsch cc @dotnet/jit-contrib A few diffs, surprisingly, improvements. I guess it's CSE failing for mismatching exception sets? |
src/coreclr/jit/earlyprop.cpp
Outdated
@@ -457,6 +457,10 @@ bool Compiler::optFoldNullCheck(GenTree* tree, LocalNumberToNullCheckTreeMap* nu | |||
nullCheckTree->SetHasOrderingSideEffect(); | |||
nullCheckTree->gtFlags |= GTF_IND_NONFAULTING; | |||
|
|||
// The current indir is no longer non-faulting. | |||
tree->gtFlags &= ~GTF_IND_NONFAULTING; | |||
tree->SetIndirExceptionFlags(this); |
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.
I presume in theory we can avoid removing GTF_IND_NONFAULTING and adding GTF_EXCEPT if the leading (if it is in fact leading) nullcheck had them, but wanted to be on a safer side
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.
Is the SetIndirExceptionFlags
necessary? I assume it should be recomputed below when all side effect flags are updated.
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.
Correct, GTF_EXCEPT is set later via gtUpdateNodeOperSideEffects, so this one is redundant
Fixes #112333
When we have:
if we decide to remove the nullcheck (when it is followed by an indirect which is recognized as an implicit nullcheck for the same address), we should update the flags in that indirect as it's no longer non-faulting.