Commit 98d0b5c
committed
Compile integer patterns to a switch
Instead of a nested if/else tree we compile such patterns to a Switch
instruction, but it results in a cleaner IR and LLVM _might_ benefit
from it (though this is hard to verify) in certain scenarios, or at
least it won't have to reconstruct an if/else tree to a switch just so
it can compile it to a jump table.
This fixes #790.
Changelog: changed1 parent 2f74a26 commit 98d0b5c
1 file changed
Lines changed: 17 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3493 | 3493 | | |
3494 | 3494 | | |
3495 | 3495 | | |
3496 | | - | |
| 3496 | + | |
| 3497 | + | |
3497 | 3498 | | |
3498 | | - | |
3499 | | - | |
| 3499 | + | |
3500 | 3500 | | |
3501 | 3501 | | |
3502 | | - | |
3503 | | - | |
3504 | | - | |
3505 | | - | |
3506 | | - | |
3507 | | - | |
3508 | | - | |
3509 | | - | |
3510 | | - | |
3511 | | - | |
3512 | | - | |
3513 | | - | |
3514 | | - | |
3515 | | - | |
3516 | | - | |
3517 | | - | |
3518 | | - | |
3519 | | - | |
3520 | | - | |
3521 | | - | |
3522 | | - | |
3523 | | - | |
3524 | | - | |
3525 | | - | |
3526 | | - | |
3527 | | - | |
3528 | | - | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
3529 | 3505 | | |
| 3506 | + | |
3530 | 3507 | | |
3531 | | - | |
3532 | | - | |
3533 | | - | |
3534 | | - | |
3535 | | - | |
3536 | | - | |
3537 | | - | |
3538 | | - | |
3539 | | - | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
3540 | 3511 | | |
3541 | 3512 | | |
3542 | | - | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
3543 | 3520 | | |
3544 | 3521 | | |
3545 | 3522 | | |
| |||
0 commit comments