Skip to content

MIR inliner, despite running, doesn't always inline trivial things like i32::le #138136

@scottmcm

Description

@scottmcm

IIRC this is due to top-down inlining restrictions, but we should find a way to ensure those restrictions don't apply to things like <i32 as PartialOrd>::le which are just a single MIR statement and therefore it's always profitable to inline them, no matter what.

See https://github.com/rust-lang/rust/pull/138135/files#diff-7f0e93ee8770e4ffe714ae19c6f0f3ab6ae1bc76e3fb03f079e11988fbbab93eR58 for an example.

Alternatively we could consider InstSimplifying them, like we do clone calls on primitives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsA-mir-opt-inliningArea: MIR inliningC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions