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: Clean up some call multi-reg ret handling #99679

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

jakobbotsch
Copy link
Member

  • Switch some IsMultiRegReturnedType calls to use GenTreeCall::HasMultiRegRetVal.
  • Remove Compiler* parameter of TreatAsShouldHaveRetBufArg; the function it was using on Compiler is static

- Switch some `IsMultiRegReturnedType` calls to use
`GenTreeCall::HasMultiRegRetVal`.
- Remove `Compiler*` parameter of `TreatAsShouldHaveRetBufArg`; the
  function it was using on `Compiler` is static
@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 13, 2024
Copy link
Contributor

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

@@ -405,55 +395,23 @@ class SubstitutePlaceholdersAndDevirtualizeWalker : public GenTreeVisitor<Substi
// candidates.
//
// Do the deferred work now.
if (retClsHnd != NO_CLASS_HANDLE)
if ((*use)->IsCall() && (*use)->AsCall()->HasMultiRegRetVal())
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this not cause diffs on platforms with multi-reg LONG returns?

Copy link
Member Author

Choose a reason for hiding this comment

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

The 32 bit builds certainly look unhappy.

Copy link
Member Author

Choose a reason for hiding this comment

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

It was causing us to call lvaSetStruct(..., nullptr, ...) and hit an assert. Added a varTypeIsStruct check back here now.

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

No diffs. Some TP regressions. They come from different inlining decisions in gtHasReg because of the switch from ShouldHaveRetBufArg to TreatAsShouldHaveRetBufArg in HasMultiRegRetVal. Hopefully native PGO will smooth that over.

@jakobbotsch jakobbotsch marked this pull request as ready for review March 20, 2024 10:54
@jakobbotsch jakobbotsch requested a review from EgorBo March 20, 2024 10:54
@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jakobbotsch
Copy link
Member Author

Ping @EgorBo

@jakobbotsch jakobbotsch merged commit 22fcf9a into dotnet:main Mar 26, 2024
144 of 154 checks passed
@jakobbotsch jakobbotsch deleted the call-multireg-ret-cleanup branch March 26, 2024 08:19
@github-actions github-actions bot locked and limited conversation to collaborators Apr 25, 2024
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.

3 participants