Stream: git-wasmtime

Topic: wasmtime / PR #14082 aarch64: skip the extend of a scalar...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 05 2026 at 19:29):

fitzgen opened PR #14082 from fitzgen:remove-extends-of-comparisons-in-aarch64-lowering to bytecodealliance:main:

icmp and fcmp on scalars both lower through lower_cond_result_bool, whose every arm already clears upper bits, so extending it is a no-op.

This removes ~18,000 uxtb instructions emitted from a PCA-based subset of Sightglass (this is ~87% of uxtb instructions emitted and 0.220% of all instructions emitted). It also results in an average 0.42% faster execution (significant) in terms of cycles.

<!--
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 (Aug 05 2026 at 19:29):

fitzgen requested alexcrichton for a review on PR #14082.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 05 2026 at 19:29):

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

view this post on Zulip Wasmtime GitHub notifications bot (Aug 05 2026 at 20:35):

fitzgen updated PR #14082.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 05 2026 at 22:05):

github-actions[bot] added the label cranelift:area:aarch64 on PR #14082.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 05 2026 at 22:05):

github-actions[bot] added the label cranelift on PR #14082.

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

alexcrichton commented on PR #14082:

We've generally tried to avoid lowering rules like this historically where correctness relies on other lowering rules in the system, although we also have some already for x64 so it's not the most principled stance per se. I'd be surprised though if this uextend+icmp showed up too too often in terms of materializing the result of a comparison vs feeding the uextend+icmp into a branch/select/trap/etc. Is this perhaps something where we could get the lion's share of the benefit by shifting around these rules to where conditions are lowered or similar?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 23:26):

fitzgen updated PR #14082.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 23:27):

fitzgen commented on PR #14082:

We've generally tried to avoid lowering rules like this historically where correctness relies on other lowering rules in the system

I pushed another commit that folds this into the matching rule, but unfortunately, this has the effect of re-lowering the icmp/fcmp at each uextend site, rather than reusing it across many. Not sure what the best way forward here is...

view this post on Zulip Wasmtime GitHub notifications bot (Aug 11 2026 at 14:22):

alexcrichton commented on PR #14082:

With optimizations enabled I think that would be resolved with GVN though, right?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 22:04):

fitzgen commented on PR #14082:

With optimizations enabled I think that would be resolved with GVN though, right?

Yeah, and in fact I read the diff backwards (d'oh) so the filetests are asserting that the duplication doesn't happen right now, so we should be good to merge this (assuming you think it looks good)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 22:18):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 22:18):

alexcrichton added PR #14082 aarch64: skip the extend of a scalar comparison's result to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 22:43):

:check: alexcrichton merged PR #14082.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 22:43):

alexcrichton removed PR #14082 aarch64: skip the extend of a scalar comparison's result from the merge queue.


Last updated: Aug 30 2026 at 10:08 UTC