Stream: git-wasmtime

Topic: wasmtime / PR #15224 Emit plain `call`s for host intrinsi...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 20:09):

fitzgen opened PR #15224 from fitzgen:no-try-call-for-host-intrinsics to bytecodealliance:main:

Rather than try_calls, whose ABI requires spilling all registers.

Doesn't really provide a difference on Sightglass when inlining is disabled, since we end up spilling for the various calls anyways in that case, but with inlining enabled it is a nice speed up:

execution :: instructions-retired :: cm-online-stats

    no-try-call (-Cinlining=y) is 1.14402x to 1.14403x faster than main (-Cinlining=y)!
    (confidence = 99%, p < 0.0001)

    ┌───────────┬───────────┬──────────────┬──────────────┬────────┬────────────────────────────┐
    │ Min       │ Max       │ Mean         │ Median       │ Noise  │ Engine                     │
    ├───────────┼───────────┼──────────────┼──────────────┼────────┼────────────────────────────┤
    │ 142345361 │ 142472755 │ 142350944.05 │ 142346567.00 │ 0.003% │ main (-Cinlining=y)        │
    ├───────────┼───────────┼──────────────┼──────────────┼────────┼────────────────────────────┤
    │ 124425291 │ 124554128 │ 124428803.16 │ 124426146.50 │ 0.003% │ no-try-call (-Cinlining=y) │
    └───────────┴───────────┴──────────────┴──────────────┴────────┴────────────────────────────┘

execution :: cycles :: cm-online-stats

    no-try-call (-Cinlining=y) is 1.0719x to 1.0725x faster than main (-Cinlining=y)!
    (confidence = 99%, p < 0.0001)

    ┌──────────┬──────────┬─────────────┬─────────────┬────────┬────────────────────────────┐
    │ Min      │ Max      │ Mean        │ Median      │ Noise  │ Engine                     │
    ├──────────┼──────────┼─────────────┼─────────────┼────────┼────────────────────────────┤
    │ 31618444 │ 31981572 │ 31655380.83 │ 31642236.00 │ 0.050% │ main (-Cinlining=y)        │
    ├──────────┼──────────┼─────────────┼─────────────┼────────┼────────────────────────────┤
    │ 29480679 │ 29633881 │ 29519890.07 │ 29519389.50 │ 0.106% │ no-try-call (-Cinlining=y) │
    └──────────┴──────────┴─────────────┴─────────────┴────────┴────────────────────────────┘

compilation :: instructions-retired :: cm-online-stats

    no-try-call (-Cinlining=y) is 1.02x to 1.04x faster than main (-Cinlining=y)!
    (confidence = 99%, p < 0.0001)

    ┌───────────┬───────────┬──────────────┬──────────────┬────────┬────────────────────────────┐
    │ Min       │ Max       │ Mean         │ Median       │ Noise  │ Engine                     │
    ├───────────┼───────────┼──────────────┼──────────────┼────────┼────────────────────────────┤
    │ 117342111 │ 174664744 │ 125618885.41 │ 124518169.50 │ 3.025% │ main (-Cinlining=y)        │
    ├───────────┼───────────┼──────────────┼──────────────┼────────┼────────────────────────────┤
    │ 113799946 │ 189075511 │ 122334071.84 │ 121347064.00 │ 4.081% │ no-try-call (-Cinlining=y) │
    └───────────┴───────────┴──────────────┴──────────────┴────────┴────────────────────────────┘

compilation :: cycles :: cm-online-stats

    No difference in performance.

    ┌──────────┬───────────┬─────────────┬─────────────┬─────────┬────────────────────────────┐
    │ Min      │ Max       │ Mean        │ Median      │ Noise   │ Engine                     │
    ├──────────┼───────────┼─────────────┼─────────────┼─────────┼────────────────────────────┤
    │ 48081718 │ 188748321 │ 82079892.83 │ 80306637.00 │ 21.279% │ main (-Cinlining=y)        │
    ├──────────┼───────────┼─────────────┼─────────────┼─────────┼────────────────────────────┤
    │ 47625101 │ 221161234 │ 78693199.53 │ 77174044.00 │ 21.531% │ no-try-call (-Cinlining=y) │
    └──────────┴───────────┴─────────────┴─────────────┴─────────┴────────────────────────────┘

<!--
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 review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

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 (Nov 10 2026 at 20:09):

fitzgen removed the review request for wasmtime-compiler-reviewers from PR #15224.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 20:09):

fitzgen requested alexcrichton for a review on PR #15224.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 20:09):

fitzgen requested wasmtime-core-reviewers for a review on PR #15224.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 20:09):

fitzgen requested wasmtime-compiler-reviewers for a review on PR #15224.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 21:31):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 21:31):

:speech_balloon: alexcrichton created PR review comment:

Perhaps a builder-style setter for may_throw rather than an alternative constructor?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 21:31):

:speech_balloon: alexcrichton created PR review comment:

FWIW I believe we could put quite a few functions into this set. For example all lowered component functions have this property because you can't ever throw an exception across component boundaries anyway. This could probably also be true for pretty much all our own libcalls, too. Perhaps a good follow-up issue?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 21:31):

:speech_balloon: alexcrichton created PR review comment:

This feels a bit confusing to me where whatever self.may_throw was prior it's unconditionally overwritten here. Could this perhaps be conditional, as well was be accompanied by a comment for why this is needed and what it's doing?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 21:33):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2026 at 21:33):

:speech_balloon: alexcrichton created PR review comment:

Question on this: this looks like it's doing half of a call $imported_function manually and then letting Call.indirect_call_inst(..) do the rest - would it be possible to make this look like a full-on call since there's a callee_index anyway?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:23):

fitzgen updated PR #15224.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:23):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:23):

:speech_balloon: fitzgen created PR review comment:

Factored out a shared helper and deduped the other places that were doing this too

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:23):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:23):

:speech_balloon: fitzgen created PR review comment:

done

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:24):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:24):

:speech_balloon: fitzgen created PR review comment:

done

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:27):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:27):

:speech_balloon: fitzgen created PR review comment:

Follow up here: https://github.com/bytecodealliance/wasmtime/issues/15234

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:28):

fitzgen has enabled auto merge for PR #15224.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:33):

fitzgen added PR #15224 Emit plain calls for host intrinsics in FACT to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:57):

:check: fitzgen merged PR #15224.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 11 2026 at 18:57):

fitzgen removed PR #15224 Emit plain calls for host intrinsics in FACT from the merge queue.


Last updated: Nov 19 2026 at 20:05 UTC