Commit 7457f51
authored
[X86] Fold VPERMV3(X,M,Y) -> VPERMV(CONCAT(X,Y),WIDEN(M)) iff the CONCAT is free (#122485)
This extends the existing fold which concatenates X and Y if they are sequential subvectors extracted from the same source.
By using combineConcatVectorOps we can recognise other patterns where X and Y can be concatenated for free (e.g. sequential loads, concatenating repeated instructions etc.), which allows the VPERMV3 fold to be a lot more aggressive.
This required combineConcatVectorOps to be extended to fold the additional case of "concat(extract_subvector(x,lo), extract_subvector(x,hi)) -> extract_subvector(x)", similar to the original VPERMV3 fold where "x" was larger than the concat result type.
This also exposes more cases where we have repeated vector/subvector loads if they have multiple uses - e.g. where we're loading a ymm and the lo/hi xmm pairs independently - in the past we've always considered this to be relatively benign, but I'm not certain if we should now do more to keep these from splitting?1 parent 019a902 commit 7457f51
22 files changed
Lines changed: 1919 additions & 1972 deletions
File tree
- llvm
- lib/Target/X86
- test/CodeGen/X86
- avx512-shuffles
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41701 | 41701 | | |
41702 | 41702 | | |
41703 | 41703 | | |
| 41704 | + | |
| 41705 | + | |
| 41706 | + | |
| 41707 | + | |
| 41708 | + | |
41704 | 41709 | | |
41705 | 41710 | | |
41706 | 41711 | | |
| |||
42401 | 42406 | | |
42402 | 42407 | | |
42403 | 42408 | | |
42404 | | - | |
42405 | | - | |
42406 | | - | |
42407 | | - | |
42408 | | - | |
42409 | | - | |
42410 | | - | |
42411 | | - | |
42412 | | - | |
42413 | | - | |
42414 | | - | |
42415 | | - | |
42416 | | - | |
42417 | | - | |
42418 | | - | |
| 42409 | + | |
| 42410 | + | |
| 42411 | + | |
| 42412 | + | |
| 42413 | + | |
| 42414 | + | |
| 42415 | + | |
| 42416 | + | |
42419 | 42417 | | |
42420 | 42418 | | |
42421 | | - | |
42422 | | - | |
| 42419 | + | |
42423 | 42420 | | |
42424 | 42421 | | |
42425 | 42422 | | |
42426 | 42423 | | |
42427 | 42424 | | |
42428 | 42425 | | |
42429 | 42426 | | |
| 42427 | + | |
| 42428 | + | |
| 42429 | + | |
42430 | 42430 | | |
42431 | 42431 | | |
42432 | 42432 | | |
| |||
57369 | 57369 | | |
57370 | 57370 | | |
57371 | 57371 | | |
57372 | | - | |
57373 | | - | |
57374 | 57372 | | |
57375 | | - | |
| 57373 | + | |
57376 | 57374 | | |
57377 | 57375 | | |
57378 | 57376 | | |
| |||
57381 | 57379 | | |
57382 | 57380 | | |
57383 | 57381 | | |
57384 | | - | |
| 57382 | + | |
| 57383 | + | |
| 57384 | + | |
| 57385 | + | |
57385 | 57386 | | |
57386 | 57387 | | |
57387 | 57388 | | |
57388 | 57389 | | |
57389 | 57390 | | |
57390 | 57391 | | |
57391 | 57392 | | |
| 57393 | + | |
| 57394 | + | |
| 57395 | + | |
| 57396 | + | |
| 57397 | + | |
| 57398 | + | |
| 57399 | + | |
| 57400 | + | |
57392 | 57401 | | |
57393 | 57402 | | |
57394 | 57403 | | |
| |||
Lines changed: 12 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1337 | 1337 | | |
1338 | 1338 | | |
1339 | 1339 | | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1344 | 1343 | | |
1345 | 1344 | | |
1346 | 1345 | | |
| |||
1789 | 1788 | | |
1790 | 1789 | | |
1791 | 1790 | | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
1795 | | - | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
1796 | 1794 | | |
1797 | 1795 | | |
1798 | 1796 | | |
| |||
1808 | 1806 | | |
1809 | 1807 | | |
1810 | 1808 | | |
1811 | | - | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
1815 | 1812 | | |
1816 | 1813 | | |
1817 | 1814 | | |
| |||
1827 | 1824 | | |
1828 | 1825 | | |
1829 | 1826 | | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
1833 | | - | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
1834 | 1830 | | |
1835 | 1831 | | |
1836 | 1832 | | |
| |||
0 commit comments