[PATCH] [X86][SSE] Generalised unpackl/unpckh shuffle matching

Chandler Carruth chandlerc at gmail.com
Wed Feb 11 13:24:00 PST 2015


On Wed, Feb 11, 2015 at 8:54 AM, Simon Pilgrim <llvm-dev at redking.me.uk>
wrote:

> Hi chandlerc, qcolombet, andreadb, spatel,
>
> The existing unpck instruction lowering was based on matching explicit
> shuffle patterns, and missed many alternative shuffle masks (notably
> commuted masks and duplicate inputs).
>

So, the commuted masks really shouldn't happen because we should be
canonicalizing the the operand order to ensure we can just check one. We
may be missing some tie-break cases in the canonicalization, but I'd much
rather attack that than test ever more permutations for unpck patterns.

For duplicate inputs, we should canonicalize those to single-input shuffles
because we usually have better shuffles than unpck for those. Where we
don't, I'm fine adding the patterns for the unpck variants directly because
it should be very obvious that there is a cost tradeoff here. Using an
unpck to lower a single-input shuffle precludes folding a load with the
shuffle.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150211/ef21084f/attachment.html>


More information about the llvm-commits mailing list