You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When matching against an Int, we currently compile the possible cases to what's essentially a nested if/else tree. However, LLVM's switch instruction works perfectly fine for integers that aren't contiguous. Compiling to a switch means LLVM might be able to better optimize the code based on the values we're matching against. This does require that on the MIR level we distinguish between exhaustive switches (as used for enum tags) and non-exhaustive switches.
Related work
No response
The text was updated successfully, but these errors were encountered:
Description
When matching against an
Int
, we currently compile the possible cases to what's essentially a nested if/else tree. However, LLVM'sswitch
instruction works perfectly fine for integers that aren't contiguous. Compiling to aswitch
means LLVM might be able to better optimize the code based on the values we're matching against. This does require that on the MIR level we distinguish between exhaustive switches (as used for enum tags) and non-exhaustive switches.Related work
No response
The text was updated successfully, but these errors were encountered: