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

Let GenTreeCopyOrReload handle scenarios when FEATURE_MULTIREG_RET is disabled #82451

Merged
merged 3 commits into from
Feb 24, 2023

Conversation

kunalspathak
Copy link
Member

@kunalspathak kunalspathak commented Feb 21, 2023

Currently Windows ABI doesn't allow to split the result and return it in multiple registers. However, in #66551, we exposed an API that will let us return the result in multiple registers. The ABI doesn't allow us to do, but since DivRem added in #66551 is an intrinsic, we should continue to let the instruction return the result in multiple registers. Thanks @tannergooding for helping me understand this concept.

GenTreeCopyOrReload had special code to handle scenario when FEATURE_MULTIREG_RET was allowed (on unix x64/arm64 and windows arm64) but this was breaking with DivRem support. The fix is to have GenTreeCopyOrReload also handle scenarios when FEATURE_MULTIREG_RET is disabled.

Fixes: #82397

@ghost ghost assigned kunalspathak Feb 21, 2023
@kunalspathak kunalspathak marked this pull request as ready for review February 22, 2023 02:05
@kunalspathak
Copy link
Member Author

@dotnet/jit-contrib @tannergooding

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

LGTM as I understand the feature and associated code

Copy link
Contributor

@SingleAccretion SingleAccretion left a comment

Choose a reason for hiding this comment

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

LGTM as well with a small comment correction.

@@ -8039,17 +8039,14 @@ struct GenTreePutArgSplit : public GenTreePutArgStk
// Represents GT_COPY or GT_RELOAD node
//
// As it turns out, these are only needed on targets that happen to have multi-reg returns.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// As it turns out, these are only needed on targets that happen to have multi-reg returns.
// Needed to support multi-reg ops.

@@ -8039,17 +8039,14 @@ struct GenTreePutArgSplit : public GenTreePutArgStk
// Represents GT_COPY or GT_RELOAD node
//
// As it turns out, these are only needed on targets that happen to have multi-reg returns.
// However, they are actually needed on any target that has any multi-reg ops. It is just
// coincidence that those are the same (and there isn't a FEATURE_MULTIREG_OPS).
// However, they are actually needed on any target that has any multi-reg ops.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// However, they are actually needed on any target that has any multi-reg ops.

Otherwise the comments contradict themselves:

... are only needed on targets that happen to have multi-reg returns ...
... are actually needed on any target that has any multi-reg ops ...

@kunalspathak
Copy link
Member Author

/azp run runtime-coreclr superpmi-diffs

@kunalspathak
Copy link
Member Author

/azp run runtime-coreclr superpmi-replay

@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).

@kunalspathak
Copy link
Member Author

kunalspathak commented Feb 24, 2023

Failures are related to #81851. Formatting jobs failures seems to be related to #82506.

@kunalspathak kunalspathak merged commit c40c9a4 into dotnet:main Feb 24, 2023
@kunalspathak kunalspathak deleted the divrem_reloadcopy branch February 24, 2023 14:46
@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants