Skip to content

JIT: Simplify ReadUtf8 immutable data extraction - #135629

Merged
EgorBo merged 1 commit into
dotnet:mainfrom
PaulusParssinen:refactor-readutf8-immutable-data
Oct 12, 2026
Merged

EgorBo merged 1 commit into
dotnet:mainfrom
PaulusParssinen:refactor-readutf8-immutable-data

Conversation

@PaulusParssinen

@PaulusParssinen PaulusParssinen commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Use GetImmutableDataFromAddress to consolidate the extraction logic and address the comment about RVA-backed input.

While exploring what it would look like to intrinsify UTF8EncodingSealed.GetByteCount for constant/immutable inputs (#102246), I came across the use of GetImmutableDataFromAddress in assertionprops for folding constant input lengths and thought using it would simplify and at the same time address the TODO-ish comment in the existing ReadUtf8 expansion. This changes the buffer for getObjectContent call use the JITs arena for allocation rather than the 512-byte stack buffer.

Not sure if this sort of simplification meets the bar but I think the change is modest and the existing src\tests\JIT\opt\Vectorization\ReadUtf8.cs regression tests should cover this so I decided to test the waters.

Use GetImmutableDataFromAddress to consolidate the extraction logic and
address the comment about RVA-backed input.
@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 Oct 12, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 12, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@EgorBo EgorBo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I think there are places we can clean up similar to this.

@EgorBo
EgorBo merged commit 29d644d into dotnet:main Oct 12, 2026
140 checks passed
@PaulusParssinen
PaulusParssinen deleted the refactor-readutf8-immutable-data branch October 12, 2026 19:36
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 14, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 14, 2026
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 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.

2 participants