Skip to content

Allow intrinsic roots in partial no-JIT compilations - #134030

Open
lewing wants to merge 2 commits into
mainfrom
lewing-fix-partial-intrinsic-roots
Open

lewing wants to merge 2 commits into
mainfrom
lewing-fix-partial-intrinsic-roots

Conversation

@lewing

@lewing lewing commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

  • allow hardware-intrinsic methods to bypass the partial profile restriction when the target cannot generate code at runtime
  • preserve profile filtering for non-intrinsic methods and for all methods on JIT-capable targets

This is related to #132825, where the affected compilation mode was observed, but it does not fully resolve that issue.

Validation

  • Required baseline: ./build.sh clr+libs+host
  • Browser-Wasm Debug: PATH=/opt/homebrew/bin:$PATH ./build.sh clr+libs -os browser -arch wasm -c Debug -cmakeargs "-DCMAKE_CXX_FLAGS=-Wno-unguarded-availability-new"
  • Browser-Wasm Release: PATH=/opt/homebrew/bin:$PATH ./build.sh clr+libs -os browser -arch wasm -c Release -cmakeargs "-DCMAKE_CXX_FLAGS=-Wno-unguarded-availability-new"
  • ILCompiler.ReadyToRun.Tests Debug and Release builds for browser-wasm

Exact repro command:

crossgen2 System.Private.CoreLib.dll \
  -r '<browser-wasm runtime pack>/*.dll' \
  --targetarch:wasm \
  --targetos:browser \
  --partial \
  --out:System.Private.CoreLib.wasm

R2RDump --entrypoints method counts:

Build PackedSimd WasmBase
Before 0 0
After 473 5

Note

This pull request description was generated with GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 16, 2026 04:56
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified that would block approval.

Review tier: Lite
Findings: None

What changed in this PR

Updates partial ReadyToRun compilation so hardware-intrinsic methods remain available on targets without runtime code generation, while preserving profile filtering elsewhere.

Changes:

  • Bypasses profile exclusion for hardware intrinsics on no-JIT targets.
  • Adds Wasm regression coverage for PackedSimd, WasmBase, and non-intrinsic methods.
  • Allows tests to simulate both JIT-capable and non-JIT targets.
File Description
src/​coreclr/​tools/​aot/​ILCompiler.ReadyToRun/​Compiler/​ReadyToRunSingleAssemblyCompilationModuleGroup.cs Updated as part of this pull request.
src/​coreclr/​tools/​aot/​ILCompiler.ReadyToRun.Tests/​WasmArgumentLayoutTests.cs Updated as part of this pull request.

@lewing
lewing requested a review from jkotas September 16, 2026 05:08
@jkotas
jkotas self-requested a review September 16, 2026 05:14
Comment thread src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/WasmArgumentLayoutTests.cs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 16, 2026 15:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Add regression coverage for partial no-JIT compilations with profiles, including non-intrinsic filtering.

Get a fresh assessment by requesting another Copilot review.

Review tier: Lite
Findings: 1 Medium severity

Open (1)

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.

3 participants