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

JIT: Unspecialize handle types after arithmetic ops in VN #70452

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

jakobbotsch
Copy link
Member

VN was retaining the precise handle types when applying arithmetic
operations to handles. This meant that we could not rely on handles of
types like GTF_ICON_METHOD_HDL actually containing an embedded method
handle after constant propagation.

This change generalizes the handle type to GTF_ICON_CONST_PTR or
GTF_ICON_GLOBAL_PTR whenever VN does anything that semantically
"unassociates" the icon from the specialized handle type.

VN was retaining the precise handle types when applying arithmetic
operations to handles. This meant that we could not rely on handles of
types like GTF_ICON_METHOD_HDL actually containing an embedded method
handle after constant propagation.

This change generalizes the handle type to GTF_ICON_CONST_PTR or
GTF_ICON_GLOBAL_PTR whenever VN does anything that semantically
"unassociates" the icon from the specialized handle type.
@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 Jun 8, 2022
@ghost ghost assigned jakobbotsch Jun 8, 2022
@ghost
Copy link

ghost commented Jun 8, 2022

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

Issue Details

VN was retaining the precise handle types when applying arithmetic
operations to handles. This meant that we could not rely on handles of
types like GTF_ICON_METHOD_HDL actually containing an embedded method
handle after constant propagation.

This change generalizes the handle type to GTF_ICON_CONST_PTR or
GTF_ICON_GLOBAL_PTR whenever VN does anything that semantically
"unassociates" the icon from the specialized handle type.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib

@jakobbotsch
Copy link
Member Author

The single diff is due to a new CSE which happens due to us using wrong handle types in impTokenToHandle when importParent is true. We have two CORINFO_HELP_NEWSFAST calls with the same handles except one of them is marked as a method instead of token, and after some arithmetic we can now CSE them.

I am fixing the impTokenToHandle problem as part of #70437.

@jakobbotsch jakobbotsch merged commit 9080239 into dotnet:main Jun 9, 2022
@jakobbotsch jakobbotsch deleted the vn-folded-handles branch June 9, 2022 17:37
@ghost ghost locked as resolved and limited conversation to collaborators Jul 9, 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.

3 participants