Wildcard pattern not optimized in match expression #108395
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following snippet generates branches (with
-C opt-level=3
)whereas spelling it out to the compiler does not:
I believe this breaks the zero cost abstraction promise.
In theory these do mean different things but for constant 16-bit integers on a modern 64-bit system they should be optimized away.
Other quirks:
(true, true) | (false, false)
still generates branchesGodbolt link: https://rust.godbolt.org/z/cWoboKM3d
The text was updated successfully, but these errors were encountered: