Check to see if this is a CONCAT_VECTORS of a bunch of EXTRACT_SUBVECTOR operations. If so, and if the EXTRACT_SUBVECTOR vector inputs come from at most two distinct vectors the same size as the result, attempt to turn this into a legal shuffle.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Hi Simon,
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
103 | This is the first place (at least on x86) where we check if VT is a legal type. | |
105 | remove extra semicolon. |
Comment Actions
Thanks Andrea, we've used the (Level < AfterLegalizeVectorOps && TLI.isTypeLegal(VT)) pattern in a lot of other shuffle code so don't have a problem adding it here.
This is the first place (at least on x86) where we check if VT is a legal type.
What about performing that check before calling 'combineConcatVectorOfExtracts' (at around line 12381)?
On x86, if VT is not legal, then we know in advance that the concat_vectors will not be folded. On other targets that don't check for the legality of VT in 'isShuffleMaskLegal', the folding would be premature. What do you think?