summaryrefslogtreecommitdiff
path: root/src/ir/module-splitting.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-09-17 13:59:17 -0700
committerGitHub <noreply@github.com>2024-09-17 13:59:17 -0700
commitda5646961c61f21dbb1d6218e370325ba43be9f0 (patch)
tree915c2853c377e6214199cb8e06997618518a7036 /src/ir/module-splitting.cpp
parentf9b64c8c5d9ad720304e101dc58790f3bbfdfc3c (diff)
downloadbinaryen-da5646961c61f21dbb1d6218e370325ba43be9f0.tar.gz
binaryen-da5646961c61f21dbb1d6218e370325ba43be9f0.tar.bz2
binaryen-da5646961c61f21dbb1d6218e370325ba43be9f0.zip
[wasm-split] Configure split functions rather than kept functions (#6949)
The configuration for the module splitting utility previous took a set of functions to keep in the primary module. Change it to take a list of functions to split into the secondary module instead. This improves the code quality in multi-split mode because it keeps stub functions generated by previous splits from being moved into secondary modules during later splits.
Diffstat (limited to 'src/ir/module-splitting.cpp')
-rw-r--r--src/ir/module-splitting.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir/module-splitting.cpp b/src/ir/module-splitting.cpp
index 777818689..caa996b30 100644
--- a/src/ir/module-splitting.cpp
+++ b/src/ir/module-splitting.cpp
@@ -442,7 +442,7 @@ ModuleSplitter::classifyFunctions(Module& primary, const Config& config) {
// module since that would make them async when they may not have the JSPI
// wrapper. Exported JSPI functions can still benefit from splitting though
// since only the JSPI wrapper stub will remain in the primary module.
- if (func->imported() || config.primaryFuncs.count(func->name) ||
+ if (func->imported() || !config.secondaryFuncs.count(func->name) ||
(config.jspi && ExportUtils::isExported(primary, *func)) ||
segmentReferrers.count(func->name)) {
primaryFuncs.insert(func->name);