Skip to content

Fix PGO consistency asserts with Then only QMarks with likelyhood in AO#129594

Open
MichalPetryka wants to merge 1 commit into
dotnet:mainfrom
MichalPetryka:patch-62
Open

Fix PGO consistency asserts with Then only QMarks with likelyhood in AO#129594
MichalPetryka wants to merge 1 commit into
dotnet:mainfrom
MichalPetryka:patch-62

Conversation

@MichalPetryka

Copy link
Copy Markdown
Contributor

Removed explicit Then handling in favour of canonicalizing to else first which fixes the issue.

cc @AndyAyersMS this seems to solve the issues we discussed on discord

Removed explicit Then handling in favour of canonicalizing to else first which fixes the issue
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 18, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 18, 2026
@MichalPetryka

Copy link
Copy Markdown
Contributor Author

@MihuBot -nuget -jitutils-repo EgorBo/jitutils -jitutils-branch pmi-deterministic-cctors

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@MichalPetryka

Copy link
Copy Markdown
Contributor Author

No diffs, less code and fixed an assert.

Comment thread src/coreclr/jit/morph.cpp
hasTrueExpr = false;
hasFalseExpr = true;
}
assert(hasFalseExpr); // we should always have false now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems a bit odd to canonicalize to else, is this just to avoid re-reversing the cond?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well the code was already reversing stuff which I assume was the part causing issues and doing it properly here once lets us not worry about having to handle only-then and only-else separately.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I get that, but the existing code that reverses has a TODO saying reversing isn't needed and now you've introduced more reversing.

So I wonder if there is a reversing-free approach that would apply nicely to both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants