summaryrefslogtreecommitdiff
path: root/test/lit/passes/vacuum-gc.wast
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-09-04 17:16:09 -0700
committerGitHub <noreply@github.com>2024-09-04 17:16:09 -0700
commit9c64fcdf873faec6b6814436bce2db35484888d7 (patch)
treee42c0bf5d8189107b043a2a261ca159b63dc7bc2 /test/lit/passes/vacuum-gc.wast
parentc64fef79147575b016ccf582c9a9bc6327f803ea (diff)
downloadbinaryen-9c64fcdf873faec6b6814436bce2db35484888d7.tar.gz
binaryen-9c64fcdf873faec6b6814436bce2db35484888d7.tar.bz2
binaryen-9c64fcdf873faec6b6814436bce2db35484888d7.zip
Use TopologicalSort::minSort to order rec groups (#6892)
Rec groups need to be topologically sorted for the output module to be valid, but the specific order of rec groups also affects the module size because types at lower indices requires fewer bytes to reference. We previously optimized for code size when gathering types by sorting the list of groups before doing the topological sort. This was brittle, though, and depended on implementation details of the topological sort to be correct. Replace the old topological sort with use of the new `TopologicalSort::minSort` utility, which is a more principled method of achieving a minimal topological sort with respect to some comparator. Also draw inspiration from ReorderGlobals and apply an exponential factor to take the users of a rec group into account when determining its weight.
Diffstat (limited to 'test/lit/passes/vacuum-gc.wast')
-rw-r--r--test/lit/passes/vacuum-gc.wast4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lit/passes/vacuum-gc.wast b/test/lit/passes/vacuum-gc.wast
index a59b2da1e..dd4934e0a 100644
--- a/test/lit/passes/vacuum-gc.wast
+++ b/test/lit/passes/vacuum-gc.wast
@@ -38,7 +38,7 @@
)
)
- ;; CHECK: (func $vacuum-nonnull (type $0)
+ ;; CHECK: (func $vacuum-nonnull (type $1)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
(func $vacuum-nonnull
@@ -101,7 +101,7 @@
)
)
- ;; CHECK: (func $dropped-calls (type $0)
+ ;; CHECK: (func $dropped-calls (type $1)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (call $helper-i32)