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: handle large OSR funclet frame initial SP delta for arm64 type 5… #66124

Merged
merged 2 commits into from
Mar 19, 2022

Conversation

AndyAyersMS
Copy link
Member

… frame

Because OSR funclet frames must pad with Tier0 frame size, initial SP delta
may exceed 240 bytes.

Fixes #65996.

… frame

Because OSR funclet frames must pad with Tier0 frame size, initial SP delta
may exceed 240 bytes.

Fixes dotnet#65996.
@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 Mar 3, 2022
@ghost ghost assigned AndyAyersMS Mar 3, 2022
@ghost
Copy link

ghost commented Mar 3, 2022

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

Issue Details

… frame

Because OSR funclet frames must pad with Tier0 frame size, initial SP delta
may exceed 240 bytes.

Fixes #65996.

Author: AndyAyersMS
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

@BruceForstall PTAL
cc @dotnet/jit-contrib

Comment on lines +13 to +29
$(CLRTestBatchPreCommands)
set COMPlus_TieredCompilation=1
set COMPlus_TC_QuickJitForLoops=1
set COMPlus_TC_OnStackReplacement=1
set COMPlus_OSR_HitLimit=2
set COMPlus_JitRandomOnStackReplacement=15
set COMPlus_JitStress=2
]]></CLRTestBatchPreCommands>
<BashCLRTestPreCommands><![CDATA[
$(BashCLRTestPreCommands)
export COMPlus_TieredCompilation=1
export COMPlus_TC_QuickJitForLoops=1
export COMPlus_TC_OnStackReplacement=1
export COMPlus_OSR_HitLimit=2
export COMPlus_JitRandomOnStackReplacement=15
export COMPlus_JitStress=2
]]></BashCLRTestPreCommands>
Copy link
Member

Choose a reason for hiding this comment

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

Is this going to be the first Pri-0 OSR test case?

Copy link
Member Author

Choose a reason for hiding this comment

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

All the tests in this directory are OSR tests. This will be the first that relies on "Random" OSR and aggressive OSR transitions. Normally those are only tested in the experimental CI legs.

I could probably rewrite the test to trigger with default OSR settings, if you think that's preferable.

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, "random" doesn't seem great in terms of repeatability? But if the seed is the method hash, then it's not actually random? Seems ok.

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.

You may want to double check the funclet prolog generation as well. It does not read fiSpDelta1 anywhere for frame type 5 which does not seem right.

@AndyAyersMS
Copy link
Member Author

You may want to double check the funclet prolog generation as well.

Thanks -- I will check.

@AndyAyersMS
Copy link
Member Author

You may want to double check the funclet prolog generation as well.

Thanks -- I will check.

Yeah, it seems wrong. For the main method this bit of SP adjust happens in the Tier0 frame, but for funclets it has to happen in the funclet prolog, and type 5 frames are missing this bit.

@AndyAyersMS
Copy link
Member Author

Turns out (because of patchpoint info skew when cross-jitting) that running natively on arm64 we don't generate a type 5 frame. So probably need to find a better test case, but for now this is better than nothing.

@AndyAyersMS
Copy link
Member Author

Trying to cleanly restart the SPMI jobs.

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr superpmi-replay

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr superpmi-asmdiffs

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

Failures seem to be known issues.

@AndyAyersMS AndyAyersMS merged commit c9252d5 into dotnet:main Mar 19, 2022
radekdoulik pushed a commit to radekdoulik/runtime that referenced this pull request Mar 30, 2022
dotnet#66124)

Because OSR funclet frames must pad with Tier0 frame size, initial SP delta
may exceed 240 bytes.

Fixes dotnet#65996.
@ghost ghost locked as resolved and limited conversation to collaborators Apr 18, 2022
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.

Assertion failed 'genFuncletInfo.fiSpDelta1 >= -240' during 'Generate code'
3 participants