Commit 2697f86
committed
[X86] visitSelect - widen select(cond,extract_subvector(shuffle(vec0)),vec1) if it will create a mask instruction
This patch extends the existing fold "select(mask, extract_subvector(shuffle(x)), zero) --> extract_subvector(select(insert_subvector(mask), shuffle(x), zero))", to also handle the non-zero case.
I've put in a restriction for VPERMV3 3 vector operands shuffles to only work with the zero select as in most circumstances we are not selecting with either of the source vectors (the only case the mask instructions match).
We should be able to generalise this in the future to work with other maskable instructions, but this is a good initial improvement.
Fixes #1134001 parent f85be26 commit 2697f86
File tree
2 files changed
+194
-142
lines changed- llvm
- lib/Target/X86
- test/CodeGen/X86/avx512-shuffles
2 files changed
+194
-142
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46835 | 46835 | | |
46836 | 46836 | | |
46837 | 46837 | | |
46838 | | - | |
46839 | | - | |
46840 | | - | |
| 46838 | + | |
| 46839 | + | |
| 46840 | + | |
46841 | 46841 | | |
46842 | 46842 | | |
46843 | 46843 | | |
| |||
46847 | 46847 | | |
46848 | 46848 | | |
46849 | 46849 | | |
46850 | | - | |
| 46850 | + | |
| 46851 | + | |
46851 | 46852 | | |
46852 | 46853 | | |
46853 | 46854 | | |
| |||
0 commit comments