Commit ec74ddd
committed
[RISCV] Combine VP_SELECT constant false to use vmerge.vxm/vmerge.vim
Currently, when the false path of a vp_select is a splat vector,
it is lowered to a vmv_v_x/vmv_v_i. The vmv is hoisted out of
the loop and the whole copy in loop body by MachineLICM.
By inverting the mask register and swapping the true and false values
in the vp_select, we can eliminate some instructions inside the loop.
corrent: https://godbolt.org/z/EnGMn3xeM
expected similar form: https://godbolt.org/z/nWhGM6Ej51 parent 6e5ee4a commit ec74ddd
File tree
3 files changed
+27
-14
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV/rvv
3 files changed
+27
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1628 | 1628 | | |
1629 | 1629 | | |
1630 | 1630 | | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
1640 | 1640 | | |
1641 | 1641 | | |
1642 | 1642 | | |
| |||
19732 | 19732 | | |
19733 | 19733 | | |
19734 | 19734 | | |
| 19735 | + | |
| 19736 | + | |
| 19737 | + | |
| 19738 | + | |
| 19739 | + | |
| 19740 | + | |
| 19741 | + | |
| 19742 | + | |
| 19743 | + | |
| 19744 | + | |
| 19745 | + | |
| 19746 | + | |
19735 | 19747 | | |
19736 | 19748 | | |
19737 | 19749 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
487 | 486 | | |
488 | | - | |
489 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| |||
0 commit comments