summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-08-16 22:14:06 -0400
committerGitHub <noreply@github.com>2024-08-17 02:14:06 +0000
commite058bfbdf31c7b59df8ab62a9ebaedac45521c12 (patch)
treeffdb01a6e5f76057a6f654c2df29f0c6e551d276 /scripts
parent95a4d5de6f65b35a64caf014c2f7febb8a799542 (diff)
downloadbinaryen-e058bfbdf31c7b59df8ab62a9ebaedac45521c12.tar.gz
binaryen-e058bfbdf31c7b59df8ab62a9ebaedac45521c12.tar.bz2
binaryen-e058bfbdf31c7b59df8ab62a9ebaedac45521c12.zip
Add a pass for minimizing recursion groups (#6832)
Most of our type optimization passes emit all non-public types as a single large rec group, which trivially ensures that different types remain different, even if they are optimized to have the same structure. Usually emitting a single large rec group is fine, but it also means that if the module is split, all of the types will need to be repeated in all of the split modules. To better support this use case, add a pass that can split the large rec group back into minimal rec groups, taking care to preserve separate type identities by emitting different permutations of the same group where possible or by inserting unused brand types to differentiate them.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/fuzz_opt.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index 4087abed1..28426f773 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -1571,6 +1571,7 @@ opt_choices = [
('--monomorphize', '--pass-arg=monomorphize-min-benefit@50'),
('--monomorphize', '--pass-arg=monomorphize-min-benefit@95'),
('--monomorphize-always',),
+ ('--minimize-rec-groups',),
('--no-stack-ir',),
('--once-reduction',),
("--optimize-casts",),