-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Copy link
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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 InstSimplify
ing them, like we do clone
calls on primitives.
Metadata
Metadata
Assignees
Labels
A-mir-optArea: MIR optimizationsArea: MIR optimizationsA-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.