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

[release/9.0] JIT: don't create vector constants from relocatable constants #107500

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 7, 2024

Backport of #107491 to release/9.0

/cc @AndyAyersMS

Customer Impact

  • Customer reported
  • Found internally

#107396

The JIT can coalesce adjacent scalar stores into a single vector store. If the values being stored are constant, then the value being stored is usually not expressible as a literal (in-code) constant and so the JIT will allocate a data segment for the constant.

However, certain constants (like function addresses) may be relocatable and need adjustment at link or load time, and there is currently no mechanism to report relocations for JIT-created data segments.

As a result, programs relying on these constants may crash, compute the wrong values, try and jump to somewhat arbitrary addresses, etc.

This fix blocks the jit from coalescing stores for relocatable constants.

Regression

  • Yes
  • No

Store coalescing is new in .NET 9: #92852

Testing

Verified on test case from the issue.

Risk

Low. The fix stops the jit from doing an optional optimization, reverting for those cases to .NET 8 behavior.

We can't represent relocations in data currently.

Fixes #107396.
@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 Sep 7, 2024
Copy link
Contributor

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

@AndyAyersMS
Copy link
Member

FYI @JulieLeeMSFT @jeffschwMSFT

@AndyAyersMS AndyAyersMS added the Servicing-consider Issue for next servicing release review label Sep 7, 2024
@teo-tsirpanis teo-tsirpanis added this to the 9.0.0 milestone Sep 8, 2024
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved. we can merge when ready

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 9, 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 Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants