Skip to content

LLVM/MIR optimizations to simplify the new RFC3058 ? desugaring #85133

Closed
@scottmcm

Description

@scottmcm

With #84767 implementing the new ? desugaring, there's no mir-opt that can simplify the double-match it emits, as the arm identity pass only does Result->Result, and thus cannot handle Result->ControlFlow->Result.

That's not a blocker for checkin, as the arm identity pass is disabled by default currently because of things like #78628 and it depends on the MIR inliner being enabled anyway, but it sure would be nice to do better here.

Zulip conversation with some more context: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Suggestions.20for.20a.20beginner/near/237739360

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-mir-optArea: MIR optimizationsC-enhancementCategory: An issue proposing an enhancement or a PR with one.F-try_trait_v2Tracking issue for RFC#3058I-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions