Commit a9af66a
committed
[RISCV] Lower (vector_interleave X, undef) to (vzext_vl X). (#87283)
If the odd vector is undef or poison, the widening add and multiply trick
doesn't work unless we freeze the odd vector.
Unfortunately, freezing doesn't work when the operand is provably
undef/poison. MIR doesn't have a representation for freeze so it
just becomes a COPY from IMPLICIT_DEF which freely propagates undef
to each operand independently.
To work around this, check for undef explicitly and lower to a VZEXT_VL
of the even vector. This produces better code than we'd get from a
freeze anyway.
I've left a FIXME for adding a freeze. I'll do that as a separate patch
as it affects other tests and doesn't help with the new test.1 parent 8c1dc5d commit a9af66a
File tree
2 files changed
+16
-14
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV/rvv
2 files changed
+16
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4624 | 4624 | | |
4625 | 4625 | | |
4626 | 4626 | | |
4627 | | - | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
4628 | 4634 | | |
4629 | 4635 | | |
4630 | 4636 | | |
| |||
4635 | 4641 | | |
4636 | 4642 | | |
4637 | 4643 | | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
4638 | 4647 | | |
4639 | 4648 | | |
4640 | 4649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | 659 | | |
663 | 660 | | |
664 | 661 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
670 | 665 | | |
671 | 666 | | |
672 | 667 | | |
673 | 668 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
679 | 672 | | |
680 | 673 | | |
681 | 674 | | |
| |||
0 commit comments