Stream: git-wasmtime

Topic: wasmtime / PR #13300 Inline `UnsafeIntrinsic` calls durin...


view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 18:40):

alexcrichton opened PR #13300 from alexcrichton:directly-inline-unsafe-intrinsics to bytecodealliance:main:

This commit is a partway resolution to #13254 borne out of discussion at today's Cranelift meeting. Inlining calls to context.{get,set} in WASIp3 by default via the standard inlining phase of Wasmtime will require taking a ~15% compile-time performance hit. This is due to the architecture of inlining currently with a "join point" where all functions are translated, then inlining happens, then functions are optimized/codegen'd. This join point results in a large loss in parallelism where otherwise when inlining is disabled functions are all compiled in parallel. The commit here is a solution to this problem for WASIp3 and UnsafeIntrinsics in general without rearchitecting all of inlining.

Specifically the translation of UnsafeIntrinsic codegen is refactored into a small, standalone, context structure to translate a single intrinsic. This is possible to create during normal intrinsic compilation in addition to during normal module compilation. When settings are appropriate the intrinsic is translated directly without a call instruction which avoids the need for the general inlining pass to be activated.

This scheme is intended to be a temporary stopgap while inlining continues to be disabled by default in Wasmtime. Once inlining is enabled by default in Wasmtime, either because it no longer has a performance hit or the hit is deemed acceptable, then this can all be removed.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 18:40):

alexcrichton requested uweigand for a review on PR #13300.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 18:40):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #13300.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 18:40):

alexcrichton requested cfallin for a review on PR #13300.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 18:40):

alexcrichton requested wasmtime-core-reviewers for a review on PR #13300.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 18:44):

alexcrichton updated PR #13300.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 18:45):

alexcrichton unassigned uweigand from PR #13300 Inline UnsafeIntrinsic calls during translation.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 22:34):

:thumbs_up: cfallin submitted PR review:

:+1:

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 22:34):

:speech_balloon: cfallin created PR review comment:

This will do a good amount of computation and will alloc a Vec -- perhaps we could test self.env.tunables.debug_guest instead?

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 22:46):

alexcrichton updated PR #13300.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 22:46):

alexcrichton has enabled auto merge for PR #13300.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 22:59):

alexcrichton added PR #13300 Inline UnsafeIntrinsic calls during translation to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 23:24):

:check: alexcrichton merged PR #13300.

view this post on Zulip Wasmtime GitHub notifications bot (May 06 2026 at 23:24):

alexcrichton removed PR #13300 Inline UnsafeIntrinsic calls during translation from the merge queue.


Last updated: Jun 01 2026 at 09:49 UTC