summaryrefslogtreecommitdiff
path: root/src/pass.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-09-27 16:13:48 -0700
committerGitHub <noreply@github.com>2021-09-27 16:13:48 -0700
commita34746c6708cd3e9d0c6ae554cd6bd40d43bb5b8 (patch)
tree9748125f12935863df63c1d9df64a9b290e3ea8c /src/pass.h
parent11552aef2a36cb90c0d7087644871777cc4a0ef7 (diff)
downloadbinaryen-a34746c6708cd3e9d0c6ae554cd6bd40d43bb5b8.tar.gz
binaryen-a34746c6708cd3e9d0c6ae554cd6bd40d43bb5b8.tar.bz2
binaryen-a34746c6708cd3e9d0c6ae554cd6bd40d43bb5b8.zip
Disable partial inlining by default and add a flag for it. (#4191)
Locally I saw a 10% speedup on j2cl but reports of regressions have arrived, so let's disable it for now pending investigation. The option added here should make it easy to experiment.
Diffstat (limited to 'src/pass.h')
-rw-r--r--src/pass.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pass.h b/src/pass.h
index 802a34ab5..2bb34aeea 100644
--- a/src/pass.h
+++ b/src/pass.h
@@ -82,6 +82,11 @@ struct InliningOptions {
// Loops usually mean the function does heavy work, so the call overhead
// is not significant and we do not inline such functions by default.
bool allowFunctionsWithLoops = false;
+ // The number of ifs to allow partial inlining of their conditions. A value of
+ // zero disables partial inlining.
+ // TODO: Investigate enabling this. Locally 4 appears useful on real-world
+ // code, but reports of regressions have arrived.
+ Index partialInliningIfs = 0;
};
struct PassOptions {