Skip to content

Skip tracking stripped ReadyToRun inlining metadata - #137053

Open
davidwrighton wants to merge 1 commit into
dotnet:mainfrom
davidwrighton:skip-stripped-r2r-inlining-info
Open

davidwrighton wants to merge 1 commit into
dotnet:mainfrom
davidwrighton:skip-stripped-r2r-inlining-info

Conversation

@davidwrighton

Copy link
Copy Markdown
Member

Summary

When --strip-inlining-info is selected, crossgen2 omits the inlining tables but still collects inlinees, merges nested-inline hash sets, copies and sorts the results into arrays, and retains those arrays on method nodes.

Skip this bookkeeping when the flag is set:

  • Do not push/pop inlinee-tracking state or collect/merge inlinee hash sets.
  • Do not create, sort, or publish inlinee arrays, which also avoids registering modules solely for inlining metadata.
  • Keep precode fixups, module activation, and cross-module IL-body/token handling active. Stripping metadata must not disable the correctness work performed by the same callbacks.

Retained-inlining-info behavior and NativeAOT's separate inlining handling are unchanged. This is independent of the debug-info change in #137037 and is based directly on main (f43900c8a9c).

Validation

Linux x64 with an existing Checked CoreCLR / Release libraries baseline:

  • ./build.sh -s clr.r2rtests -test -rc checked -lc release — passed before and after the product change: 198 total, 183 passed, 15 skipped, zero failures, zero build warnings/errors.
  • The existing basic cross-module, transitive-reference, and composite-inlining tests now cover both flag values. All six cases passed; stripped cross-module cases retain Check_IL_Body fixups and required manifest references, while inlining sections are absent. These are output-preservation checks for an internal optimization and also pass on the baseline.
  • ./dotnet.sh build src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj -c Checked — passed, zero warnings/errors.
  • git diff --check — passed.

Browser/Wasm execution, Windows, and other target architectures were not run locally.

Compiler-cost diagnostic

Compared saved baseline and changed Checked crossgen2 builds compiling the same CoreLib IL and references with --optimize --parallelism 4 --targetos linux --targetarch x64, with and without --strip-inlining-info. Linux/WSL2, Intel Core i7-7800X, 12 logical CPUs. Three measured fresh processes per build/configuration after discarding one warmup each, alternating baseline/changed order; no concurrent builds.

Inlining information Baseline median time Changed median time Baseline median peak RSS Changed median peak RSS
Stripped 15.32 s 14.99 s 515,956 KiB 516,360 KiB
Retained 15.74 s 15.38 s 513,948 KiB 500,172 KiB

These are end-to-end compiler diagnostics, not BenchmarkDotNet results or a statistical-significance claim. In particular, this sample does not demonstrate a peak-memory improvement for stripping; process RSS remains variable.

All compiler invocations succeeded. Outputs were byte-for-byte identical between baseline and changed builds within each configuration: 14,931,968 bytes stripped and 15,115,264 bytes retained.

Note

This pull request was prepared with GitHub Copilot.

Avoid inlinee hash-set tracking, nested-inline state, sorted arrays, and metadata-only module registration when --strip-inlining-info is set. Preserve callback fixups, module activation, and cross-module IL handling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dd6ed1f7-f085-4a84-9769-9cc1fab81e69
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 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: @dotnet/crossgen-contrib
See info in area-owners.md if you want to be subscribed.

@davidwrighton
davidwrighton marked this pull request as ready for review November 5, 2026 23:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants