-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: Set edge likelihoods during patchpoint transformation #97897
Merged
amanasifkhalid
merged 6 commits into
dotnet:main
from
amanasifkhalid:likelihood-jitstress
Feb 5, 2024
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0d21a25
Fix JitStress
amanasifkhalid 8c32b37
Uncomment assert
amanasifkhalid cd3e30d
Fix likelihoods
amanasifkhalid fc6255f
Update likelihoods
amanasifkhalid c042cbb
Remove unnecessary assert
amanasifkhalid 56696dc
Update src/coreclr/jit/patchpoint.cpp
amanasifkhalid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The test actually passing should be very rare (I believe the threshold is 1/10000). Also, isn't
trueEdge
always going to be theBBJ_ALWAYS
edge inserted byfgSplitBlockAtBeginning
above, so the check here is a bit meaningless?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.
Ah you're right, so
trueEdge
should always have an edge likelihood here. I'll remove the branch.Is there any value to being more precise than 0.1/0.9 for
trueEdge
/falseEdge
's likelihoods?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.
In tier0? Doubtful. Also 1/10000 is not entirely accurate since I believe multiple patchpoints share the counter, but @AndyAyersMS can correct me if I'm wrong...
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 see below this snippet that
helperBlock
inherits 1% ofblock
's weight; should we have the edge likelihoods match that? SotrueEdge
is 0.99, andfalseEdge
is 0.01.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.
Makes sense to me to be consistent with that. On further look it looks like
TC_OnStackReplacement_InitialCounter
is 1000. Not sure if the mismatch is intentional or not; in a way, the most accurate guess we could make is probably1 / <that value>
, but feel free to stick with the 1% here.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.
Overall it probably doesn't matter since (at least for now) we only have patchpoints in unoptimized code. I guess I'd go with the precedent already there and use the 0.99/0.01 split.