Optimize matches!()
invocations at the MIR level
#75141
Labels
A-mir-opt
Area: MIR optimizations
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Right now,
matches!()
generates MIR that sometimes has more branches than required. As an example:generates this MIR:
Notice blocks
bb0
,bb1
,bb2
andbb3
which we could transform into something like this:There may be a compile-time win since we can hand LLVM less code but the optimization would have to be implemented to be sure.
cc @rust-lang/wg-mir-opt
The text was updated successfully, but these errors were encountered: