Skip to content

JIT: Allow containment of CnsVec under GetElement node with non-const index #117562

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 1 commit into from
Jul 14, 2025

Conversation

saucecontrol
Copy link
Member

@saucecontrol saucecontrol commented Jul 11, 2025

This enables a pattern like Vector128.GetElement(Vector128.Create(cns, cns, ...), noncns) to emit a read directly into the data section instead of loading the CnsVec, spilling it to the stack, and indexing into it there.

This is added primarily to support a cast implementation to come in another PR.

(peeled from #116805)

@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 11, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 11, 2025
Copy link
Contributor

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

@saucecontrol
Copy link
Member Author

cc @tannergooding

Diffs show a couple of hits in tests, but it's not expected this is a common pattern.

re: matching this optimization for WithElement, that doesn't work because that one spills to the stack for writing -- this only helps when we can read from the data section instead of the spill.

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

CC. @dotnet/jit-contrib for secondary review

@tannergooding
Copy link
Member

spmi replay failure is #117550

@tannergooding
Copy link
Member

/ba-g unrelated android timeouts

@tannergooding tannergooding merged commit ede442a into dotnet:main Jul 14, 2025
114 of 118 checks passed
@saucecontrol saucecontrol deleted the getlement-const branch July 14, 2025 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants