Skip to content

Conversation

xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Sep 8, 2025

These changes show significant improvements in codegen, see MihuBot/runtime-utils#1456.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 8, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 8, 2025
@EgorBo
Copy link
Member

EgorBo commented Sep 8, 2025

Mainly a simplification for readability.

To be fair, I'm not sure it improves the readability in any way, more like the opposite IMO

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Sep 9, 2025

Mainly a simplification for readability.

To be fair, I'm not sure it improves the readability in any way, more like the opposite IMO

It simplifies a bit more if we change SpanHelpers.Replace length parameter to take nint and remove the uint cast. This would also enable strength reduction in some of the implementation loops.

@EgorBo
Copy link
Member

EgorBo commented Sep 9, 2025

Mainly a simplification for readability.

To be fair, I'm not sure it improves the readability in any way, more like the opposite IMO

It simplifies a bit more if we change SpanHelpers.Replace length parameter to take nint and remove the uint cast. This would also enable strength reduction in some of the implementation loops.

not sure I follow. Replace currently accepts nuint, why'd we want to change it to nint

xtqqczze added a commit to xtqqczze/dotnet-runtime that referenced this pull request Sep 9, 2025
@xtqqczze xtqqczze changed the title Avoid local for span length inMemoryExtensions.Replace Improve codegen for MemoryExtensions.Replace Sep 9, 2025
@tannergooding
Copy link
Member

@MihuBot

@tannergooding tannergooding merged commit 1d93e4c into dotnet:main Sep 10, 2025
144 of 146 checks passed
@xtqqczze xtqqczze deleted the memoryextensionsreplace branch September 10, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants