From cfeddd741f6503457c6c4a5e1741d91eb0e7e08d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 22 Aug 2017 10:27:52 -0700 Subject: Inline many (#1125) * Improve inlining pass to inline single-use functions that are fairly small, which makes it useful for removing unnecessary global constructors from clang. * Add an inlining-optimizing pass that also optimizes where it inlined, as new opportunities arise. enable that it by default in O2+ * In addition, in -O3+ also inline small functions with multiple uses. This helps a lot with things like safe-int-divide functions (where each int divide is replaced by a safe divide that won't trap). Inlining gets rid of around half of the overhead there. --- src/passes/pass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/passes/pass.cpp') diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index 37eb50a0b..1e56169df 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -72,8 +72,8 @@ void PassRegistry::registerPasses() { registerPass("duplicate-function-elimination", "removes duplicate functions", createDuplicateFunctionEliminationPass); registerPass("extract-function", "leaves just one function (useful for debugging)", createExtractFunctionPass); registerPass("flatten-control-flow", "flattens out control flow to be only on blocks, not nested as expressions", createFlattenControlFlowPass); - registerPass("inlining", "inlines functions (currently only ones with a single use)", createInliningPass); - registerPass("inlining-optimizing", "inlines functions (currently only ones with a single use) and optimizes where we inlined", createInliningOptimizingPass); + registerPass("inlining", "inlines functions", createInliningPass); + registerPass("inlining-optimizing", "inlines functions and optimizes where we inlined", createInliningOptimizingPass); registerPass("legalize-js-interface", "legalizes i64 types on the import/export boundary", createLegalizeJSInterfacePass); registerPass("local-cse", "common subexpression elimination inside basic blocks", createLocalCSEPass); registerPass("log-execution", "instrument the build with logging of where execution goes", createLogExecutionPass); -- cgit v1.2.3