Commit 96e58b8
authored
[RISCV] Legalize misaligned unmasked vp.load/vp.store to vle8/vse8. (llvm#167745)
If vector-unaligned-mem support is not enabled, we should not generate
loads/stores that are not aligned to their element size.
We already do this for non-VP vector loads/stores.
This code has been in our downstream for about a year and a half after
finding the vectorizer generating misaligned loads/stores. I don't think
that is unique to our downstream.
Doing this for masked vp.load/store requires widening the mask as well
which is harder to do.
NOTE: Because we have to scale the VL, this will introduce additional
vsetvli and the VL optimizer will not be effective at optimizing any
arithmetic that is consumed by the store.1 parent 4ab2423 commit 96e58b8
File tree
6 files changed
+141
-6
lines changed- llvm
- lib
- CodeGen/SelectionDAG
- Target/RISCV
- test/CodeGen/RISCV/rvv
6 files changed
+141
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9913 | 9913 | | |
9914 | 9914 | | |
9915 | 9915 | | |
9916 | | - | |
9917 | | - | |
9918 | 9916 | | |
9919 | 9917 | | |
9920 | 9918 | | |
| |||
9936 | 9934 | | |
9937 | 9935 | | |
9938 | 9936 | | |
| 9937 | + | |
| 9938 | + | |
| 9939 | + | |
| 9940 | + | |
| 9941 | + | |
9939 | 9942 | | |
9940 | 9943 | | |
9941 | 9944 | | |
| |||
10031 | 10034 | | |
10032 | 10035 | | |
10033 | 10036 | | |
| 10037 | + | |
| 10038 | + | |
| 10039 | + | |
| 10040 | + | |
10034 | 10041 | | |
10035 | 10042 | | |
10036 | 10043 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6846 | 6846 | | |
6847 | 6847 | | |
6848 | 6848 | | |
| 6849 | + | |
| 6850 | + | |
| 6851 | + | |
| 6852 | + | |
| 6853 | + | |
| 6854 | + | |
| 6855 | + | |
| 6856 | + | |
| 6857 | + | |
| 6858 | + | |
| 6859 | + | |
| 6860 | + | |
| 6861 | + | |
| 6862 | + | |
| 6863 | + | |
| 6864 | + | |
| 6865 | + | |
| 6866 | + | |
| 6867 | + | |
| 6868 | + | |
| 6869 | + | |
| 6870 | + | |
| 6871 | + | |
| 6872 | + | |
| 6873 | + | |
| 6874 | + | |
| 6875 | + | |
| 6876 | + | |
| 6877 | + | |
| 6878 | + | |
| 6879 | + | |
| 6880 | + | |
| 6881 | + | |
| 6882 | + | |
| 6883 | + | |
| 6884 | + | |
| 6885 | + | |
| 6886 | + | |
| 6887 | + | |
| 6888 | + | |
| 6889 | + | |
| 6890 | + | |
| 6891 | + | |
| 6892 | + | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
| 6896 | + | |
| 6897 | + | |
| 6898 | + | |
| 6899 | + | |
| 6900 | + | |
| 6901 | + | |
| 6902 | + | |
| 6903 | + | |
| 6904 | + | |
| 6905 | + | |
| 6906 | + | |
| 6907 | + | |
| 6908 | + | |
| 6909 | + | |
| 6910 | + | |
| 6911 | + | |
| 6912 | + | |
| 6913 | + | |
| 6914 | + | |
| 6915 | + | |
| 6916 | + | |
| 6917 | + | |
| 6918 | + | |
| 6919 | + | |
| 6920 | + | |
| 6921 | + | |
| 6922 | + | |
| 6923 | + | |
| 6924 | + | |
| 6925 | + | |
| 6926 | + | |
| 6927 | + | |
| 6928 | + | |
| 6929 | + | |
| 6930 | + | |
| 6931 | + | |
| 6932 | + | |
| 6933 | + | |
| 6934 | + | |
| 6935 | + | |
| 6936 | + | |
| 6937 | + | |
| 6938 | + | |
| 6939 | + | |
| 6940 | + | |
| 6941 | + | |
6849 | 6942 | | |
6850 | 6943 | | |
6851 | 6944 | | |
| |||
8401 | 8494 | | |
8402 | 8495 | | |
8403 | 8496 | | |
8404 | | - | |
8405 | 8497 | | |
| 8498 | + | |
| 8499 | + | |
| 8500 | + | |
| 8501 | + | |
8406 | 8502 | | |
8407 | 8503 | | |
8408 | 8504 | | |
8409 | | - | |
8410 | 8505 | | |
| 8506 | + | |
| 8507 | + | |
| 8508 | + | |
| 8509 | + | |
8411 | 8510 | | |
8412 | 8511 | | |
8413 | 8512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
579 | 582 | | |
580 | 583 | | |
581 | 584 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
| 183 | + | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
615 | 628 | | |
616 | 629 | | |
617 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
514 | 527 | | |
515 | 528 | | |
516 | 529 | | |
| |||
0 commit comments