From da5646961c61f21dbb1d6218e370325ba43be9f0 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Tue, 17 Sep 2024 13:59:17 -0700 Subject: [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. --- src/ir/module-splitting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir/module-splitting.cpp') 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); -- cgit v1.2.3