KEMBAR78
Ensure the assert in IsEmbMaskOp is correct by tannergooding · Pull Request #98306 · dotnet/runtime · GitHub
Skip to content

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.

@ghost ghost 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