-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: Make isRemovableJmpCandidate less restrictive on AMD64 #95493
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1b45b83
Make isRemovableJmpCandidate less restrictive
amanasifkhalid 08b69b0
Update comment
amanasifkhalid d7e2ea3
Rename emitNop variable
amanasifkhalid 8cd2847
Replace jump with nop after call on AMD64
amanasifkhalid 64c68b9
Print nop in disasms
amanasifkhalid 7e84c50
Emit nop only if before OS epilog
amanasifkhalid 354839f
Style
amanasifkhalid f15b182
Fix TP diff from nop print logic
amanasifkhalid e949e2c
Fix condition around printing nops
amanasifkhalid 26ca790
Simplify emitJmpInstHasNoCode
amanasifkhalid 964d728
Improve Linux TP
amanasifkhalid 056ae1a
Feedback
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
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
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1869,14 +1869,20 @@ class emitter | |||||
// beginning of the function -- of the target instruction of the jump, used to | ||||||
// determine if this jump needs to be patched. | ||||||
unsigned idjOffs : | ||||||
#if defined(TARGET_XARCH) | ||||||
29; | ||||||
// indicates that the jump was added at the end of a BBJ_ALWAYS basic block and is | ||||||
#if defined(TARGET_AMD64) | ||||||
28; | ||||||
// Indicates the jump was added at the end of a BBJ_ALWAYS basic block and is | ||||||
// a candidate for being removed if it jumps to the next instruction | ||||||
unsigned idjIsRemovableJmpCandidate : 1; | ||||||
// Indicates the jump succeeds a call instruction; if this jump is removed, | ||||||
// a nop will need to be emitted instead (see clr-abi.md for details) | ||||||
unsigned idjIsAfterCall : 1; | ||||||
#elif defined(TARGET_XARCH) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You split off amd64, so the only "xarch" left is x86
Suggested change
|
||||||
29; | ||||||
unsigned idjIsRemovableJmpCandidate : 1; | ||||||
#else | ||||||
30; | ||||||
#endif | ||||||
#endif // !defined(TARGET_XARCH) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO, this comment is not actually helpful. |
||||||
unsigned idjShort : 1; // is the jump known to be a short one? | ||||||
unsigned idjKeepLong : 1; // should the jump be kept long? (used for hot to cold and cold to hot jumps) | ||||||
}; | ||||||
|
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.
fwiw, all this bit fiddling is silly on 64-bit, where we're going to have 32 bits of padding after the
unsigned
fields, in which case we should just move all the bits to the end and make thembool :1
fields. Maybe not for 32-bit, though.But that shouldn't be done in this PR :)
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.
Good point, I'll come back to this in a follow-up PR.