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

JIT: Fix emitSplit to properly handle the remainder #90246

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

jakobbotsch
Copy link
Member

emitSplit did not handle the edge case where the last instruction group of the function/funclet resulted in the size to overflow the max. Use a lambda so we can call the necessary code both as part of the loop and after the loop.

Fix #85063

emitSplit did not handle the edge case where the last instruction group
of the function/funclet resulted in the size to overflow the max. Use a
lambda so we can call the necessary code both as part of the loop and
after the loop.

Fix dotnet#85063
@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 Aug 9, 2023
@ghost ghost assigned jakobbotsch Aug 9, 2023
@ghost
Copy link

ghost commented Aug 9, 2023

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

Issue Details

emitSplit did not handle the edge case where the last instruction group of the function/funclet resulted in the size to overflow the max. Use a lambda so we can call the necessary code both as part of the loop and after the loop.

Fix #85063

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

Diff of related JitDump in the Antigen example in #85063 (back on 2032a59, as it does not repro on main):

@@ -175,6 +175,9 @@ reserveUnwindInfo(isFunclet=true, isColdCode=false, unwindSize=0x10)
 reserveUnwindInfo(isFunclet=true, isColdCode=false, unwindSize=0x10)
 Split unwind info into 2 fragments (function/funclet size: 2096588, maximum fragment size: 1048576)
 emitSplit: split at IG16039 is size ffdc4, less than requested maximum size of 100000
+emitSplit: split at IG20065 is size ffff0, less than requested maximum size of 100000
 reserveUnwindInfo(isFunclet=true, isColdCode=false, unwindSize=0xc)
 reserveUnwindInfo: fragment #2:
+reserveUnwindInfo(isFunclet=true, isColdCode=false, unwindSize=0x10)
+reserveUnwindInfo: fragment #3:
 reserveUnwindInfo(isFunclet=true, isColdCode=false, unwindSize=0x14)

@jakobbotsch jakobbotsch marked this pull request as ready for review August 9, 2023 19:23
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @BruceForstall

Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

LGTM

@jakobbotsch jakobbotsch merged commit 405a62f into dotnet:main Aug 9, 2023
@jakobbotsch jakobbotsch deleted the fix-85063 branch August 9, 2023 22:39
@ghost ghost locked as resolved and limited conversation to collaborators Sep 9, 2023
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
2 participants