Skip to content

JIT: Fix folding of GC pointer arithmetic in lowering #108838

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 6 commits into from
Oct 21, 2024

Conversation

jakobbotsch
Copy link
Member

Fix #108830

Based on #108836 (to avoid regressions)

The TLS helper expansion would produce `ADD(long, int)` trees like
```
▌  STORE_LCL_VAR long   V01 rat0
└──▌  ADD       long
   ├──▌  ADD       long
   │  ├──▌  LCL_VAR   long   V02 rat1
   │  └──▌  CNS_INT   int    72 $41
   └──▌  CNS_INT   long   192
```

which is not legal IR. Fix that by inserting a cast. Also do some more
aggressive folding to get rid of these casts in the normal cases, and to
fold some constant arithmeticf in other cases.
@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 Oct 14, 2024
@jakobbotsch jakobbotsch marked this pull request as ready for review October 21, 2024 08:18
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs

@jakobbotsch jakobbotsch requested a review from EgorBo October 21, 2024 09:55
@jakobbotsch jakobbotsch merged commit 82256bf into dotnet:main Oct 21, 2024
108 checks passed
@jakobbotsch jakobbotsch deleted the fix-108830 branch October 21, 2024 22:38
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2024
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.

Test failure: JIT/Regression/JitBlue/Runtime_64208/Runtime_64208/Runtime_64208.cmd
3 participants