summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pass.h7
-rw-r--r--src/tools/optimization-options.h9
2 files changed, 8 insertions, 8 deletions
diff --git a/src/pass.h b/src/pass.h
index 643d9a25a..dd7c67bc1 100644
--- a/src/pass.h
+++ b/src/pass.h
@@ -69,9 +69,10 @@ struct InliningOptions {
// More generally, with 2 items we may have a local.get, but no way to
// require it to be saved instead of directly consumed.
Index alwaysInlineMaxSize = 2;
- // Function size which we inline when there is only one caller.
- // FIXME: this should logically be higher than flexibleInlineMaxSize.
- Index oneCallerInlineMaxSize = 15;
+ // Function size which we inline when there is only one caller. By default we
+ // inline all such functions (as after inlining we can remove the original
+ // function).
+ Index oneCallerInlineMaxSize = -1;
// Function size above which we never inline, ignoring the various flexible
// factors (like whether we are optimizing for size or speed) that could
// influence us.
diff --git a/src/tools/optimization-options.h b/src/tools/optimization-options.h
index 4f5c9e0d1..0e6157473 100644
--- a/src/tools/optimization-options.h
+++ b/src/tools/optimization-options.h
@@ -155,13 +155,12 @@ struct OptimizationOptions : public ToolOptions {
.add("--one-caller-inline-max-function-size",
"-ocimfs",
"Max size of functions that are inlined when there is only one "
- "caller (default " +
- std::to_string(InliningOptions().oneCallerInlineMaxSize) +
- "). Reason this is not unbounded is that some "
- "implementations may have a hard time optimizing really large "
- "functions",
+ "caller (default -1, which means all such functions are inlined)",
Options::Arguments::One,
[this](Options* o, const std::string& argument) {
+ static_assert(InliningOptions().oneCallerInlineMaxSize ==
+ Index(-1),
+ "the help text here is written to assume -1");
passOptions.inlining.oneCallerInlineMaxSize =
static_cast<Index>(atoi(argument.c_str()));
})