Skip to content

Commit 3221690

Browse files
authored
wasm-reduce: Enable GlobalTypeOptimization (#7887)
We made that pass require --closed-world at some point. Since then, all attempts by the reducer to use it failed, sadly. This helps reduce some GC testcases quite a lot.
1 parent 3b518c1 commit 3221690

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/tools/wasm-reduce/wasm-reduce.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ struct Reducer
279279
"--dce",
280280
"--duplicate-function-elimination",
281281
"--enclose-world",
282-
"--gto",
282+
"--gto --closed-world",
283283
"--inlining",
284284
"--inlining-optimizing",
285285
"--optimize-level=3 --inlining-optimizing",

test/reduce/gc.wast

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(module
22
(rec
3+
;; The funcref field can be optimized away with --gto.
34
(type $A (struct (field (mut i32)) (field funcref)))
45
;; This type can be optimized away.
56
(type $unused (struct))

test/reduce/gc.wast.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(module
2-
(type $0 (struct (field (mut i32)) (field funcref)))
2+
(type $0 (struct (field (mut i32))))
33
(type $1 (func (result i32)))
44
(global $global$0 (ref null $0) (struct.new_default $0))
55
(export "use-global" (func $0))

0 commit comments

Comments
 (0)