-
Notifications
You must be signed in to change notification settings - Fork 127
Description
The -flambda2-speculative-inlining-only-if-arguments-useful check is intended to only perform speculative inlining if we have more information on the arguments (at the call site) than on the parameters (at the function definition).
At the moment, the check is implemented in a very naïve way: it simply checks if we know anything about the argument at the call site. Since the addition of or_null kinds, this is almost never (we frequently know at least that an argument is not null), so the check was kind of useless.
This is fixed in #5093, but as pointed out in that discussion, the check is still less useful than it could be, because we'd expect "useful" information to at least be more precise than whatever we had on the initial parameters. It is not clear what "more precise" should mean (e.g. currently we can do simplifications due to equalities between arguments, or because an argument is a symbol, etc.), but the check could likely be more aggressive.
But let's be careful and not make it too aggressive either.