Skip to content

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