Skip to content

Fix arm64 scalar intrinsic use with small arguments #73876

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

Merged
merged 1 commit into from
Aug 13, 2022

Conversation

BruceForstall
Copy link
Contributor

The code already uses emitActualTypeSize in the scalar case;
this also uses genActualType to get the "actual" type of small
types when deciding the intrinsic base type, used in codegen.

Fixes #73804

The code already uses `emitActualTypeSize` in the scalar case;
this also uses `genActualType` to get the "actual" type of small
types when deciding the intrinsic base type, used in codegen.

Fixes dotnet#73804
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 12, 2022
@ghost ghost assigned BruceForstall Aug 12, 2022
@ghost
Copy link

ghost commented Aug 12, 2022

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

Issue Details

The code already uses emitActualTypeSize in the scalar case;
this also uses genActualType to get the "actual" type of small
types when deciding the intrinsic base type, used in codegen.

Fixes #73804

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@BruceForstall
Copy link
Contributor Author

No diffs

@BruceForstall
Copy link
Contributor Author

@tannergooding @dotnet/jit-contrib PTAL

@@ -866,6 +866,11 @@ struct HWIntrinsic final
{
baseType = node->TypeGet();
}

if (category == HW_Category_Scalar)
Copy link
Member

Choose a reason for hiding this comment

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

What about the HW_Category_Special category? Likely the above three cases that get a type via GenTree::TypeGet should be changed to use genActualType(tree) instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to make a targeted change, and hadn't fully investigated all the processing that "Special" nodes have. It turns out that this class is only used on arm64, and the only "special" instruction is "Yield", which has no arguments, and for which the "baseType" is ignored. So I could just make the genActualType unconditional as you suggest.

@adamsitnik
Copy link
Member

@BruceForstall @jakobbotsch can this PR be merged now?

@jakobbotsch
Copy link
Member

@BruceForstall @jakobbotsch can this PR be merged now?

I am ok with merging this as is if you are blocked on this.

@BruceForstall BruceForstall merged commit 3478472 into dotnet:main Aug 13, 2022
@BruceForstall BruceForstall deleted the Fix73804 branch August 13, 2022 21:49
@adamsitnik
Copy link
Member

@BruceForstall @jakobbotsch thank you both!

@adamsitnik adamsitnik added this to the 7.0.0 milestone Aug 14, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 13, 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.

[arm64] JIT assertion failures for valid C# code
3 participants