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: Create side effect commas as TYP_VOID in block morph #85320

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Apr 25, 2023

This code could create IR shapes like

COMMA struct
  ...
  ASG struct
    dst
    src

After liveness that would sometimes result in

COMMA struct
  ...
  NOP void

which could confuse optimization phases when JitOptRepeat was enabled.

The more canonical shape for these side-effecting GT_COMMA nodes has them TYP_VOID typed as shown by gtExtractSideEffList, so do the same in block morph.

Fix #85037

There are still other cases where we produce the non-canonical typed commas, e.g. impAssignStruct. I started trying to fix it but it looks like it will take a larger clean up.

This code could create IR shapes like

COMMA struct
  ...
  ASG struct
    dst
    src

After liveness that would sometimes result in

COMMA struct
  ...
  NOP void

which could confuse optimization phases when JitOptRepeat was enabled.

The more canonical shape for these side-effecting GT_COMMA nodes has
them TYP_VOID typed as shown by gtExtractSideEffList, so do the same in
block morph.

Fix dotnet#85037
@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 Apr 25, 2023
@ghost ghost assigned jakobbotsch Apr 25, 2023
@ghost
Copy link

ghost commented Apr 25, 2023

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

Issue Details

This code could create IR shapes like

COMMA struct
  ...
  ASG struct
    dst
    src
`` 

After liveness that would sometimes result in

COMMA struct
...
NOP void
``

which could confuse optimization phases when JitOptRepeat was enabled.

The more canonical shape for these side-effecting GT_COMMA nodes has them TYP_VOID typed as shown by gtExtractSideEffList, so do the same in block morph.

Fix #85037

There are still other cases where we produce the non-canonical typed commas, e.g. impAssignStruct. I started trying to fix it but it looks like it will take a larger clean up.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

@jakobbotsch jakobbotsch requested a review from EgorBo April 25, 2023 18:03
@jakobbotsch jakobbotsch merged commit 21001dc into dotnet:main Apr 25, 2023
@jakobbotsch jakobbotsch deleted the fix-85037 branch April 25, 2023 18:14
@ghost ghost locked as resolved and limited conversation to collaborators May 25, 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.

Assertion failed 'varTypeIsStruct(TypeGet())' during 'Optimize Valnum CSEs'
2 participants