-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-let_chains`#![feature(let_chains)]``#![feature(let_chains)]`I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-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
At the time of writing, if $c { $i } else { $e }
builds MIR that is simpler and therefore is ~1-3% better in terms of compile times than match $c { $i } else { $e }
. However, after the early-opt
MIR optimization, they are basically the same.
In #59288 we start desugaring if
expressions to match
and so if we optimize for the special case of two match arms we can potentially improve compiles times.
cc @oli-obk
Metadata
Metadata
Assignees
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-let_chains`#![feature(let_chains)]``#![feature(let_chains)]`I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-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.