Repository navigation
Skip tracking stripped ReadyToRun inlining metadata - #137053
Merged
Merged
Conversation
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: 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. |
Contributor
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
jkotas
approved these changes
Nov 5, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The stripped-mode tests can pass without the new allocation-skipping guards, leaving inlinee tracking and null InlinedMethods behavior unverified by an in-process test with retained compilation as a control.
1 open issue
What changed in this PR
This PR avoids collecting and retaining ReadyToRun inlining metadata when --strip-inlining-info is enabled, while preserving correctness-related work and NativeAOT’s separate handling.
Changes:
- Skip inlinee tracking, nested-set merging, and inlinee-array creation and publication when metadata is stripped.
- Preserve precode fixups, module activation, and cross-module IL-body/token handling.
- Extend three existing test scenarios to cover stripped and retained metadata.
| File | Description |
|---|---|
src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs |
Skip creating, sorting, and publishing stripped inlinee arrays. |
src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs |
Guard inlinee bookkeeping without bypassing correctness work. |
src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/R2RTestSuites.cs |
Test both flag values and verify metadata sections, fixups, and references. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
When
--strip-inlining-infois 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:
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.Check_IL_Bodyfixups 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.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.