diff options
author | Max Graey <maxgraey@gmail.com> | 2020-09-05 04:30:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 18:30:25 -0700 |
commit | 8b436ba3046deb69e5b736a6cef003b8b0dde0c0 (patch) | |
tree | 2259b0139e1bcc310475e2b4f8615b8167a24309 /src/tools | |
parent | 44df23efd69fd2dd4c260755c82ddede226c40ff (diff) | |
download | binaryen-8b436ba3046deb69e5b736a6cef003b8b0dde0c0.tar.gz binaryen-8b436ba3046deb69e5b736a6cef003b8b0dde0c0.tar.bz2 binaryen-8b436ba3046deb69e5b736a6cef003b8b0dde0c0.zip |
Improve inlining "heavyweight" (#3085)
Split that mode into an option to check for loops (which indicate a function
is "heavy") and a constant check for having calls. The case of calls is
different as we would need more logic to avoid infinite recursion if we are
willing to inling functions with calls.
Practically, this renames allowHeavyweight to allowFunctionsWithLoops.
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/optimization-options.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/optimization-options.h b/src/tools/optimization-options.h index ff43b7213..72f478329 100644 --- a/src/tools/optimization-options.h +++ b/src/tools/optimization-options.h @@ -165,12 +165,12 @@ struct OptimizationOptions : public ToolOptions { passOptions.inlining.oneCallerInlineMaxSize = static_cast<Index>(atoi(argument.c_str())); }) - .add("--inline-heavyweight-functions", - "-ihf", - "Allow inlining heavyweight functions", + .add("--inline-functions-with-loops", + "-ifwl", + "Allow inlining functions with loops", Options::Arguments::Zero, [this](Options* o, const std::string&) { - passOptions.inlining.allowHeavyweight = true; + passOptions.inlining.allowFunctionsWithLoops = true; }) .add("--ignore-implicit-traps", "-iit", |