Commit 543d812
[DAG][RISCV] Use vp_reduce_* when widening illegal types for reductions (llvm#105455)
This allows the use a single wider operation with a restricted EVL
instead of padding the vector with the neutral element.
For RISCV specifically, it's worth noting that an alternate padded
lowering is available when VL is one less than a power of two, and LMUL
<= m1. We could slide the vector operand up by one, and insert the
padding via a vslide1up. We don't currently pattern match this, but we
could. This form would arguably be better iff the surrounding code
wanted VL=4. This patch will force a VL toggle in that case instead.
Basically, it comes down to a question of whether we think odd sized
vectors are going to appear clustered with odd size vector operations,
or mixed in with larger power of two operations.
Note there is a potential downside of using vp nodes; we loose any
generic DAG combines which might have applied to the widened form.1 parent d7ccccb commit 543d812
File tree
6 files changed
+158
-202
lines changed- llvm
- include/llvm/IR
- lib/CodeGen/SelectionDAG
- test/CodeGen/RISCV/rvv
6 files changed
+158
-202
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
654 | | - | |
| 654 | + | |
655 | 655 | | |
656 | 656 | | |
| 657 | + | |
657 | 658 | | |
658 | 659 | | |
659 | 660 | | |
660 | 661 | | |
661 | 662 | | |
662 | | - | |
| 663 | + | |
663 | 664 | | |
664 | 665 | | |
665 | 666 | | |
666 | | - | |
| 667 | + | |
667 | 668 | | |
668 | 669 | | |
669 | 670 | | |
670 | | - | |
| 671 | + | |
671 | 672 | | |
672 | 673 | | |
673 | 674 | | |
674 | | - | |
| 675 | + | |
675 | 676 | | |
676 | 677 | | |
677 | 678 | | |
678 | | - | |
| 679 | + | |
679 | 680 | | |
680 | 681 | | |
681 | 682 | | |
682 | | - | |
| 683 | + | |
683 | 684 | | |
684 | 685 | | |
685 | 686 | | |
686 | | - | |
| 687 | + | |
687 | 688 | | |
688 | 689 | | |
689 | 690 | | |
690 | | - | |
| 691 | + | |
691 | 692 | | |
692 | 693 | | |
693 | 694 | | |
694 | | - | |
| 695 | + | |
695 | 696 | | |
696 | 697 | | |
697 | 698 | | |
698 | | - | |
| 699 | + | |
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
702 | | - | |
| 703 | + | |
703 | 704 | | |
704 | 705 | | |
705 | 706 | | |
706 | | - | |
| 707 | + | |
707 | 708 | | |
708 | 709 | | |
709 | 710 | | |
710 | | - | |
| 711 | + | |
711 | 712 | | |
712 | 713 | | |
713 | 714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7271 | 7271 | | |
7272 | 7272 | | |
7273 | 7273 | | |
| 7274 | + | |
| 7275 | + | |
| 7276 | + | |
| 7277 | + | |
| 7278 | + | |
| 7279 | + | |
| 7280 | + | |
| 7281 | + | |
| 7282 | + | |
| 7283 | + | |
| 7284 | + | |
| 7285 | + | |
| 7286 | + | |
| 7287 | + | |
| 7288 | + | |
| 7289 | + | |
| 7290 | + | |
| 7291 | + | |
| 7292 | + | |
7274 | 7293 | | |
7275 | 7294 | | |
7276 | 7295 | | |
| 7296 | + | |
7277 | 7297 | | |
7278 | 7298 | | |
7279 | 7299 | | |
| |||
7288 | 7308 | | |
7289 | 7309 | | |
7290 | 7310 | | |
| 7311 | + | |
| 7312 | + | |
| 7313 | + | |
| 7314 | + | |
| 7315 | + | |
| 7316 | + | |
| 7317 | + | |
| 7318 | + | |
| 7319 | + | |
| 7320 | + | |
| 7321 | + | |
| 7322 | + | |
| 7323 | + | |
| 7324 | + | |
| 7325 | + | |
| 7326 | + | |
| 7327 | + | |
| 7328 | + | |
| 7329 | + | |
7291 | 7330 | | |
7292 | 7331 | | |
7293 | 7332 | | |
| |||
7296 | 7335 | | |
7297 | 7336 | | |
7298 | 7337 | | |
7299 | | - | |
| 7338 | + | |
7300 | 7339 | | |
7301 | 7340 | | |
7302 | 7341 | | |
7303 | 7342 | | |
7304 | 7343 | | |
7305 | 7344 | | |
7306 | | - | |
| 7345 | + | |
7307 | 7346 | | |
7308 | 7347 | | |
7309 | 7348 | | |
| |||
0 commit comments