Skip to content

Commit 6cd9b4a

Browse files
Cranelift: update to regalloc2 0.12.2; support many return values. (#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 #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]>
1 parent 29d04b1 commit 6cd9b4a

File tree

5 files changed

+84
-5
lines changed

5 files changed

+84
-5
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ byte-array-literals = { path = "crates/wasi-preview1-component-adapter/byte-arra
289289

290290
# Bytecode Alliance maintained dependencies:
291291
# ---------------------------
292-
regalloc2 = "0.12.1"
292+
regalloc2 = "0.12.2"
293293

294294
# cap-std family:
295295
target-lexicon = "0.13.0"

supply-chain/imports.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,8 @@ user-login = "dtolnay"
11661166
user-name = "David Tolnay"
11671167

11681168
[[publisher.regalloc2]]
1169-
version = "0.12.1"
1170-
when = "2025-04-15"
1169+
version = "0.12.2"
1170+
when = "2025-05-07"
11711171
user-id = 3726
11721172
user-login = "cfallin"
11731173
user-name = "Chris Fallin"

tests/disas/many-return-values.wat

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
;;! target = "x86_64"
2+
;;! test = "compile"
3+
4+
(module
5+
(type $t
6+
(func
7+
(result
8+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 10
9+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 20
10+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 30
11+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 40
12+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 50
13+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 60
14+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 70
15+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 80
16+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 90
17+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 100
18+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 110
19+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 120
20+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 130
21+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 140
22+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 150
23+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 160
24+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 170
25+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 180
26+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 190
27+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 200
28+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 210
29+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 220
30+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 230
31+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 240
32+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 250
33+
i32 i32 i32 i32 ;; 254
34+
)
35+
)
36+
)
37+
(export "f" (func $f))
38+
(func $f (type $t) (unreachable))
39+
)
40+
;; wasm[0]::function[0]::f:
41+
;; pushq %rbp
42+
;; movq %rsp, %rbp
43+
;; ud2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
(module
2+
(type $t
3+
(func
4+
(result
5+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 10
6+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 20
7+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 30
8+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 40
9+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 50
10+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 60
11+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 70
12+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 80
13+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 90
14+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 100
15+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 110
16+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 120
17+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 130
18+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 140
19+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 150
20+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 160
21+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 170
22+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 180
23+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 190
24+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 200
25+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 210
26+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 220
27+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 230
28+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 240
29+
i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 ;; 250
30+
i32 i32 i32 i32 ;; 254
31+
)
32+
)
33+
)
34+
(export "f" (func $f))
35+
(func $f (type $t) (unreachable))
36+
)

0 commit comments

Comments
 (0)