Skip to content

Conversation

@cfallin
Copy link
Member

@cfallin cfallin commented May 7, 2025

Prior versions of regalloc2 could not support more than 255 operands on an instruction, and together with the integrated return-value loads on call instructions introduced in #10502, this caused issues with calls with many returns. This PR upgrades to a version of RA2 that supports up to 2^16 - 1 operands per instruction (well in excess of the maximum of 1000 return/result values per Wasm's implementation limits, for example).

Fixes #10741.

@cfallin cfallin requested review from a team as code owners May 7, 2025 20:40
@cfallin cfallin requested review from alexcrichton and removed request for a team May 7, 2025 20:40
@cfallin
Copy link
Member Author

cfallin commented May 7, 2025

In attempting to update cargo vet metadata, I'm seeing that perhaps we've failed to update for new crates:

% cargo vet
ERROR   × There are some issues with your policy.audit-as-crates-io entries

Error:   × Some non-crates.io-fetched packages match published crates.io versions
  │   cranelift-srcgen:0.120.0
  │   wasmtime-wasi-tls:33.0.0

will need to work out exactly how we handle this again...

Prior versions of regalloc2 could not support more than 255 operands on
an instruction, and together with the integrated return-value loads on
call instructions introduced in bytecodealliance#10502, this caused issues with calls
with many returns. This PR upgrades to a version of RA2 that supports up
to `2^16 - 1` operands per instruction (well in excess of the maximum of
1000 return/result values per Wasm's implementation limits, for
example).

Fixes bytecodealliance#10741.
@cfallin cfallin force-pushed the fix-too-many-return-values branch from 9d87044 to 74af426 Compare May 7, 2025 20:45
@alexcrichton
Copy link
Member

Do you have the latest cargo vet version? (0.10.1 for me)

Otherwise, before this PR, if you run cargo vet does it change anything or have any errors?

@cfallin
Copy link
Member Author

cfallin commented May 7, 2025

Yes, I have v0.10.1; and I actually get the same errors on main. I need to context-switch and don't have time to dig into the innards of cargo-vet now so if someone else knows how to fix this it would be much appreciated...

@alexcrichton
Copy link
Member

Looks like it needed a merge/rebase with main first

@alexcrichton alexcrichton enabled auto-merge May 7, 2025 20:58
@cfallin
Copy link
Member Author

cfallin commented May 7, 2025

Ah, awesome, thanks -- that's what I get for not updating my local main with regular development!

@alexcrichton alexcrichton added this pull request to the merge queue May 7, 2025
Merged via the queue into bytecodealliance:main with commit 6cd9b4a May 7, 2025
41 checks passed
@cfallin cfallin deleted the fix-too-many-return-values branch May 7, 2025 21:39
cfallin added a commit to cfallin/wasmtime that referenced this pull request May 7, 2025
…ytecodealliance#10747)

* Cranelift: update to regalloc2 0.12.2; support many return values.

Prior versions of regalloc2 could not support more than 255 operands on
an instruction, and together with the integrated return-value loads on
call instructions introduced in bytecodealliance#10502, this caused issues with calls
with many returns. This PR upgrades to a version of RA2 that supports up
to `2^16 - 1` operands per instruction (well in excess of the maximum of
1000 return/result values per Wasm's implementation limits, for
example).

Fixes bytecodealliance#10741.

* Update vets

---------

Co-authored-by: Alex Crichton <[email protected]>
alexcrichton added a commit that referenced this pull request May 7, 2025
…10747) (#10748)

* Cranelift: update to regalloc2 0.12.2; support many return values.

Prior versions of regalloc2 could not support more than 255 operands on
an instruction, and together with the integrated return-value loads on
call instructions introduced in #10502, this caused issues with calls
with many returns. This PR upgrades to a version of RA2 that supports up
to `2^16 - 1` operands per instruction (well in excess of the maximum of
1000 return/result values per Wasm's implementation limits, for
example).

Fixes #10741.

* Update vets

---------

Co-authored-by: Alex Crichton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codegen fails when exporting a function with long result type

2 participants