Skip to content

JIT: Preserve inlining of profiled memcmp fallback - #135373

Merged
EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:fix-profiled-memcmp-fallback-inlining
Oct 8, 2026
Merged

EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:fix-profiled-memcmp-fallback-inlining

Conversation

@EgorBo

@EgorBo EgorBo commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Preserve inlining of the variable-length fallback when specializing profiled SequenceEqual calls. Clearing the original call's inline-candidate information before cloning also prevented fallback inlining, introducing helper calls and vector-register spills when the size guess missed.

Keep the fallback's candidate information and return placeholder, and expand the QMARK before inlining. The fixed-size fast path remains eligible for unrolling.

On Windows x64, SliceSlice improves from 296.3 ms to 276.5 ms (pre-PR baseline: 281.9 ms). A reduced Span.IndexOf repro that trains with a seven-character needle, then searches with a four-character needle improves from 942 ns to 524 ns (baseline: 528 ns).

Fixes #134865.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 6a688f5c-c26c-447f-b932-75363c0d4e11
@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 7, 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 commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

@EgorBot -linux_amd -linux_intel --filter 'System.Text.RegularExpressions.Tests.Perf_Regex_Industry_SliceSlice*'

@JulieLeeMSFT JulieLeeMSFT 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.

LGTM.

@EgorBo
EgorBo merged commit a7bdb83 into dotnet:main Oct 8, 2026
141 of 143 checks passed
@EgorBo
EgorBo deleted the fix-profiled-memcmp-fallback-inlining branch October 8, 2026 11:27
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 13, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Perf] Linux/x64: 12 Regressions on 9/23/2026 12:53:18 PM +00:00

2 participants