Skip to content

Ensure the assert in IsEmbMaskOp is correct #98306

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 2 commits into from
Feb 13, 2024

Conversation

tannergooding
Copy link
Member

The IsEmbMaskOp API is only expected to be called for GT_HWINTRINSIC nodes since it reuses bits valid for specific other node kinds.

@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 Feb 12, 2024
@ghost ghost assigned tannergooding Feb 12, 2024
@ghost
Copy link

ghost commented Feb 12, 2024

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

Issue Details

The IsEmbMaskOp API is only expected to be called for GT_HWINTRINSIC nodes since it reuses bits valid for specific other node kinds.

Author: tannergooding
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@tannergooding
Copy link
Member Author

CC. @BruceForstall, this fixes the feedback given in #97675 (comment)

bool result = (gtFlags & GTF_HW_EM_OP) != 0;
assert(!result || (gtOper == GT_HWINTRINSIC));
return result;
return OperIsHWIntrinsic() && ((gtFlags & GTF_HW_EM_OP) != 0);
Copy link
Member Author

Choose a reason for hiding this comment

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

None of the callsites were checking OperIsHWIntrinsic() first, so needed to make the check explicit.

Asserting in MakeEmbMaskOp was then appropriate since it did check first.

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