kutluhaneth46 opened PR #15197 from kutluhaneth46:fix/cranelift-boxed-slice-argpair to bytecodealliance:main:
Summary
Addresses #5879 for the
Args/Retspseudo-instructions.These lists are built once during ABI setup and never change length afterward, so storing
Box<[ArgPair]>/Box<[RetPair]>inside the MachInst saves one machine word per instruction versusVec(24 → 16 bytes for the list header on 64-bit). Builders still useVecwhile collecting pairs, then callinto_boxed_slice()when emitting the pseudo-inst.Measurement
On this machine (
size_offor the list headers):
Type Bytes (64-bit) Vec<T>24 Box<[T]>16 So each
Inst::Args/Inst::Retsthat lives in the VCode heap carries a smaller header. Full end-to-end compile benchmarks are welcome if reviewers want them; this PR keeps the change focused on the type the issue called out (ArgPair/ matchingRetPair).Testing
cargo check -p cranelift-codegen
kutluhaneth46 removed the review request for wasmtime-compiler-reviewers from PR #15197.
kutluhaneth46 requested cfallin for a review on PR #15197.
kutluhaneth46 requested wasmtime-compiler-reviewers for a review on PR #15197.
kutluhaneth46 requested wasmtime-compiler-s390x-reviewers for a review on PR #15197.
kutluhaneth46 updated PR #15197.
github-actions[bot] added the label cranelift:area:machinst on PR #15197.
github-actions[bot] added the label cranelift on PR #15197.
github-actions[bot] added the label cranelift:area:aarch64 on PR #15197.
github-actions[bot] added the label cranelift:area:x64 on PR #15197.
github-actions[bot] added the label isle on PR #15197.
github-actions[bot] commented on PR #15197:
Subscribe to Label Action
cc @avanhatt, @cfallin, @fitzgen, @mmcloughlin
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "cranelift:area:machinst", "cranelift:area:x64", "isle"Thus the following users have been cc'd because of the following labels:
- avanhatt: isle
- cfallin: isle
- fitzgen: isle
- mmcloughlin: isle
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
:thumbs_up: cfallin submitted PR review:
Change LGTM modulo the cleanup below.
Note that this won't actually shrink
MInstI believe, as there are still variants that are larger, but it's a nice tightening of the types regardless.
:speech_balloon: cfallin created PR review comment:
Thanks! Let's rename this type alias (including in the ISLE code where it's used) to something like
BoxedSliceArgPair; likewise below in the other backends.
:memo: kutluhaneth46 submitted PR review.
:speech_balloon: kutluhaneth46 created PR review comment:
Renamed to
BoxedSliceArgPair/BoxedSliceRetPairin the ISLE aliases and across backends. Thanks for the review.
kutluhaneth46 updated PR #15197.
kutluhaneth46 commented on PR #15197:
Renamed to
BoxedSliceArgPair/BoxedSliceRetPairin the ISLE aliases and across backends. Thanks for the review.
cfallin added PR #15197 cranelift: store Args/Rets pairs in Box<[T]> instead of Vec to the merge queue.
:check: cfallin merged PR #15197.
cfallin removed PR #15197 cranelift: store Args/Rets pairs in Box<[T]> instead of Vec from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC