Skip to content

Revisit the "arguments useful" check #5150

@bclement-ocp

Description

@bclement-ocp

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.

Metadata

Metadata

Assignees

Labels

flambda2Prerequisite for, or part of, flambda2inliningRelated to inlining/speculative inlining

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions