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

Consistently use fgMakeMultiUse in the gtNewSimd*Node APIs #80242

Merged
merged 8 commits into from
Jan 11, 2023

Conversation

tannergooding
Copy link
Member

This resolves a known issue with several of the helper APIs in that they were using impCloneExpr even though they were not exclusive to import.

@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 Jan 5, 2023
@ghost ghost assigned tannergooding Jan 5, 2023
@ghost
Copy link

ghost commented Jan 5, 2023

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

Issue Details

This resolves a known issue with several of the helper APIs in that they were using impCloneExpr even though they were not exclusive to import.

Author: tannergooding
Assignees: tannergooding
Labels:

area-CodeGen-coreclr

Milestone: -

@tannergooding tannergooding marked this pull request as ready for review January 10, 2023 21:50
@tannergooding
Copy link
Member Author

tannergooding commented Jan 10, 2023

CC. @dotnet/jit-contrib, @jakobbotsch should be ready for review

Couple tiny regressions in tests, but that's somewhat expected since we're introducing a COMMA and doing the "right" thing now.

@tannergooding
Copy link
Member Author

/azp run runtime-coreclr jitstress-isas-x86, runtime-coreclr jitstress-isas-arm, runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@tannergooding
Copy link
Member Author

/azp run runtime-coreclr jitstress-isas-x86, runtime-coreclr jitstress-isas-arm, runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@tannergooding
Copy link
Member Author

/azp run runtime-coreclr jitstress-isas-x86, runtime-coreclr jitstress-isas-arm, runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

Added some questions.

// op2 = Sse2.Multiply(op2.AsUInt32(), op1.AsUInt32()).AsInt32()
op2 = gtNewSimdHWIntrinsicNode(type, op2, op1, NI_SSE2_Multiply, CORINFO_TYPE_ULONG, simdSize,
isSimdAsHWIntrinsic);
// op2Dup = Sse2.Multiply(op1Dup.AsUInt32(), op2Dup.AsUInt32()).AsInt32()
Copy link
Member

Choose a reason for hiding this comment

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

Did you swap the op2 and op1 here? Earlier it was gtNewSimdHWIntrinsicNode(type, op2, op1,...) and now it is gtNewSimdHWIntrinsicNode(type, op1Dup, op2Dup,...).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but it's multiply and so is commutative.

In general we need to try and preserve evaluation order of the inputs. This is particularly important when using fgMakeMultiUse since it can introduce a GT_COMMA rather than just inserting a new GT_ASG node like impCloneExpr does.


op2 = gtNewSimdBinOpNode(GT_AND, type, v, u, simdBaseJitType, simdSize, isSimdAsHWIntrinsic);
op2 = gtNewSimdBinOpNode(GT_AND, type, u, v, simdBaseJitType, simdSize, isSimdAsHWIntrinsic);
Copy link
Member

Choose a reason for hiding this comment

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

curious about this change? I assume it is just for the variable name alphabetical ordering?

Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above. This is GT_AND and so is commutative. We need to order the parameters correctly to preserve evaluation order.

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

LGTM

@tannergooding
Copy link
Member Author

Test failures are known, being disabled in #80522

@tannergooding tannergooding merged commit 3f5210d into dotnet:main Jan 11, 2023
@tannergooding tannergooding deleted the fgMakeMultiUse branch January 11, 2023 23:00
@ghost ghost locked as resolved and limited conversation to collaborators Feb 11, 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
Development

Successfully merging this pull request may close these issues.

2 participants