Skip to content
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

Fix PHI non-null pattern #104493

Closed
wants to merge 5 commits into from
Closed

Fix PHI non-null pattern #104493

wants to merge 5 commits into from

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Jul 5, 2024

Closes #104489

Thanks to @AndyAyersMS and @jakobbotsch for ideas how to fix it.

Let's see what CI thinks..

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 5, 2024
@EgorBo
Copy link
Member Author

EgorBo commented Jul 5, 2024

@MihuBot

@EgorBo EgorBo marked this pull request as ready for review July 12, 2024 18:01
@EgorBo
Copy link
Member Author

EgorBo commented Jul 12, 2024

PTAL @AndyAyersMS @jakobbotsch cc @dotnet/jit-contrib Diffs

I tried to fix the TP hit by only inspecting root node for PHI, but there is still 0.1% regression. Can we accept it?

@@ -1149,16 +1149,14 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
}
}

if (fgIsBigOffset(offset) || op1->gtOper != GT_LCL_VAR)
if (fgIsBigOffset(offset) || !op1->IsLocal())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change ok? LCL_FLD will create an assertion about the parent local without encoding any information about the offset, which seems odd.

Comment on lines -11139 to -11144
else if (value->TypeGet() == TYP_REF)
{
// If we have an unsafe IL store of a TYP_REF to a non-ref (typically a TYP_BYREF)
// then don't propagate this ValueNumber to the lhs, instead create a new unique VN.
valueVNPair.SetBoth(vnStore->VNForExpr(compCurBB, store->TypeGet()));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to see if you can dig up why this was added to verify it won't cause any problems to remove it.

@EgorBo EgorBo added this to the 10.0.0 milestone Jul 31, 2024
@EgorBo
Copy link
Member Author

EgorBo commented Oct 3, 2024

superseded by #108420

@EgorBo EgorBo closed this Oct 3, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JIT: nullcheck is not folded for PHI
2 participants