Thanks to visit codestin.com
Credit goes to github.com

Skip to content

JIT: Introduce O1K_VN #112889

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

Merged
merged 3 commits into from
Feb 25, 2025
Merged

JIT: Introduce O1K_VN #112889

merged 3 commits into from
Feb 25, 2025

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Feb 25, 2025

Fixes a bug that caused #112872 revert

O1K_ARR_BND used to have a complex semantics - it supported different kinds of asserts, now it's always used only with OAK_NO_THROW kind.
The newly introduced O1K_VN is sort of similar to O1K_LCLVAR but works for any VN.

The change should actually be an improvement, because previously, O1K_ARR_BND with ==/!= was a bit conservative on when to create such an assertion. Possible regressions from "too many assertions".

@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 Feb 25, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@EgorBo EgorBo marked this pull request as ready for review February 25, 2025 02:49
@Copilot Copilot AI review requested due to automatic review settings February 25, 2025 02:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@EgorBo
Copy link
Member Author

EgorBo commented Feb 25, 2025

/azp run runtime-coreclr libraries-pgo, runtime-coreclr jitstress

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@EgorBo
Copy link
Member Author

EgorBo commented Feb 25, 2025

PTAL @jakobbotsch @dotnet/jit-contrib the fix that we've discussed in Discord. I'll see if I can move more LCLVAR into VN in the future. Diffs
The regressions will be handled by #110171 e.g. avoid creaking X != NegativeCns assertions as they're useless.

All failures are #112856

@EgorBo EgorBo requested a review from jakobbotsch February 25, 2025 10:25
@@ -787,6 +791,10 @@ void Compiler::optPrintAssertion(AssertionDsc* curAssertion, AssertionIndex asse
vnStore->vnDump(this, curAssertion->op1.bnd.vnLen);
printf("]");
}
else if (curAssertion->op1.kind == O1K_VN)
{
printf("[" FMT_VN "]", curAssertion->op1.vn);
Copy link
Member

Choose a reason for hiding this comment

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

Use vnStore->vnDump?

Copy link
Member Author

Choose a reason for hiding this comment

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

will address in #110171

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM. It would make sense to me if we changed range check to actually get the constant from the assertion now:

else if (curAssertion->IsConstantInt32Assertion())
{
if (curAssertion->op1.vn != normalLclVN)
{
continue;
}
int cnstLimit = m_pCompiler->vnStore->CoercedConstantValue<int>(curAssertion->op2.vn);

@EgorBo
Copy link
Member Author

EgorBo commented Feb 25, 2025

LGTM. It would make sense to me if we changed range check to actually get the constant from the assertion now:

Agree, I'll address that in #110171 that I'll rebase after this lands

@EgorBo EgorBo merged commit d0fe41c into dotnet:main Feb 25, 2025
123 of 137 checks passed
@EgorBo EgorBo deleted the o1k_vn branch February 25, 2025 12:12
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2025
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.

2 participants