Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/coreclr/jit/earlyprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member Author

@EgorBo EgorBo Feb 20, 2025

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

Copy link
Member

@jakobbotsch jakobbotsch Feb 20, 2025

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.

Copy link
Member Author

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


if (nullCheckParent != nullptr)
{
nullCheckParent->gtFlags &= ~GTF_DONT_CSE;
Expand Down
Loading