From a34746c6708cd3e9d0c6ae554cd6bd40d43bb5b8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 27 Sep 2021 16:13:48 -0700 Subject: 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. --- src/pass.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/pass.h') 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 { -- cgit v1.2.3