Skip to content

Conversation

@SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Aug 24, 2022

Keep the return descriptor for the method being compiled and use it in various places.

Deletes the dependence of multi-reg RETURN backend code on precise handles of LCL_VAR operands.

Fixes #36868.

Tiny amount of diffs on ARM64: some forward substitutions of non-multireg SIMDs are now allowed.

@ghost ghost added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member labels Aug 24, 2022
@ghost
Copy link

ghost commented Aug 24, 2022

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

Issue Details

Keep the return descriptor for the method being compiled and use it in various places.

Deletes the dependence of multi-reg RETURN backend code on precise handles of LCL_VAR operands.

Fixes #36868.

Depends on #72887.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@SingleAccretion
Copy link
Contributor Author

@dotnet/jit-contrib

@AndyAyersMS
Copy link
Member

@dotnet/jit-contrib anyone up for reviewing this? Looks like a nice cleanup but cuts across a lot of code.

@jakobbotsch
Copy link
Member

I can take a look, but it'll probably take me some time to get familiar with multi-reg returns.

@jakobbotsch jakobbotsch self-assigned this Sep 22, 2022
@jakobbotsch jakobbotsch self-requested a review September 22, 2022 13:50
Add the return type descriptor to compiler and use it.

Delete target-specific code from "impFixupStructReturnType".

The main target of this change is getting rid of the dependency
of multi-reg RETURN backend code on exact struct handles on temps
it expects as the sources.
Due to the buggy nature of the old code, the matrix for what
substititions were allowed was as follows:

       ARM         x86
LONG   not-LCL_VAR NONE
STRUCT LCL_VAR     LCL_VAR

This commit preserves this extremely quirky behavior.

Unfortunately, just enabling the propagation is a CQ regression
due to some RA issues.
// TODO-Review: this seems unnecessary. Return ABI doesn't change under varargs.
&& !op->AsCall()->IsVarargs()
#endif // defined(TARGET_ARMARCH) || defined(TARGET_LOONGARCH64)
)
Copy link
Member

Choose a reason for hiding this comment

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

Seems likely this check is not necessary at all anymore after #73059.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, not really.

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.

This looks great to me, very nice cleanup. I'll trigger some stress legs.

@jakobbotsch
Copy link
Member

/azp run runtime-coreclr jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@SingleAccretion
Copy link
Contributor Author

Stress failures look like #76550, #76507 and #76280.

@jakobbotsch
Copy link
Member

Thanks!

@jakobbotsch jakobbotsch merged commit be5a4d3 into dotnet:main Oct 6, 2022
@SingleAccretion SingleAccretion deleted the Return-Cleanup branch October 6, 2022 23:17
@ghost ghost locked as resolved and limited conversation to collaborators Nov 6, 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 community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clear/fix compMethodReturnsMultiRegRetType and similar functions.

3 participants