Open
Description
Consider the program:
fn program(x: u8) -> u8 {
match x {
1 | 2 | 3 | 4 => 0,
_ => 1,
}
}
We will generate the following SwitchInt
:
switchInt(_1) -> [1u8: bb2, 2u8: bb2, 3u8: bb2, 4u8: bb2, otherwise: bb1];
Ostensibly, something like this would be more profitable:
_2 = Le(const 1u8, _1);
switchInt(move _2) -> [false: bb2, otherwise: bb3];
This is the code you get from the range pattern 0..=4
.