VALIGND and VALIGNQ are similar to PALIGNR but instead of working on a 128-bit lane they work on the entire vector register. This change leverages the shuffle rotate detection code used for PALIGNR to detect these cases.
Details
Diff Detail
Event Timeline
Please can you add the new tests to trunk with the existing lowering?
For 128-bit vectors, we favor VALIGND/Q over PALIGNR so that we naturely match the vector element size in case the shuffle is part of a masked operation
Would we be better off putting this logic into combineSelect() and keep to PALIGNR? Detect mask/maskz selects taking a bitcasted target shuffles/logicals/whatever and attempt to narrow/widen them back? Not certain if this would actually work in general, its just a thought.
That sounds like a good idea. We can leave it as PALIGNR and not even try to do PALIGND/Q for 128-bit until combineSelect. Less code in shuffle lowering is probably best.
Add current codegen to trunk to show the diffs in the tests?
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
12215 | Will this ever fire? |
Updating tests to only show difference in codegen with this patch.
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
12215 | VALIGND/Q work on the whole vector. PALIGNR works on 128-bit lanes so they should cover different cases. |
LGTM - please can you create a PR about the AVX512 combineSelect shuffle/logical widening/narrowing idea (unless you intend to do it very soon).
I'll see if we can add matchVectorShuffleAsRotate to matchBinaryPermuteVectorShuffle.
Will this ever fire?