Codegen Optimization for Non-Consecutive Enum Match Arms #140849
Labels
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
It was compiled as jump table.
For the case of smaller range, the compiler used another optimization.
For the case taht matching arms are more than 4, the compiler used lookup table.
I expected this, which can be attained only when the arm values are consecutive.
Meta
rustc --version --verbose
:Compiler options:
The text was updated successfully, but these errors were encountered: