Commit 876114f
authored
[X86] Add widenBuildVector to create a wider build vector if the scalars are mergeable (llvm#167667)
See if each pair of scalar operands of a build vector can be freely
merged together - typically if they've been split for some reason by
legalization.
If we can create a new build vector node with double the scalar size,
but half the element count - reducing codegen complexity and potentially
allowing further optimization.
I did look at performing this generically in DAGCombine, but we don't
have as much control over when a legal build vector can be folded -
another generic fold would be to handle this on insert_vector_elt pairs,
but again legality checks could be limiting.
Fixes llvm#1674981 parent 59c01cc commit 876114f
File tree
3 files changed
+141
-339
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86
3 files changed
+141
-339
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8865 | 8865 | | |
8866 | 8866 | | |
8867 | 8867 | | |
| 8868 | + | |
| 8869 | + | |
| 8870 | + | |
| 8871 | + | |
| 8872 | + | |
| 8873 | + | |
| 8874 | + | |
| 8875 | + | |
| 8876 | + | |
| 8877 | + | |
| 8878 | + | |
| 8879 | + | |
| 8880 | + | |
| 8881 | + | |
| 8882 | + | |
| 8883 | + | |
| 8884 | + | |
| 8885 | + | |
| 8886 | + | |
| 8887 | + | |
| 8888 | + | |
| 8889 | + | |
| 8890 | + | |
| 8891 | + | |
| 8892 | + | |
| 8893 | + | |
| 8894 | + | |
| 8895 | + | |
| 8896 | + | |
| 8897 | + | |
| 8898 | + | |
| 8899 | + | |
| 8900 | + | |
| 8901 | + | |
| 8902 | + | |
| 8903 | + | |
| 8904 | + | |
| 8905 | + | |
| 8906 | + | |
| 8907 | + | |
| 8908 | + | |
| 8909 | + | |
| 8910 | + | |
| 8911 | + | |
| 8912 | + | |
| 8913 | + | |
| 8914 | + | |
| 8915 | + | |
| 8916 | + | |
| 8917 | + | |
8868 | 8918 | | |
8869 | 8919 | | |
8870 | 8920 | | |
| |||
9335 | 9385 | | |
9336 | 9386 | | |
9337 | 9387 | | |
| 9388 | + | |
| 9389 | + | |
9338 | 9390 | | |
9339 | 9391 | | |
9340 | 9392 | | |
| |||
0 commit comments