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

Chandler Carruth chandlerc at gmail.com
Wed Feb 18 14:57:30 PST 2015


On Wed, Feb 18, 2015 at 2:17 PM, Simon Pilgrim <llvm-dev at redking.me.uk>
wrote:

> I agree that adding multiple shuffle pattern matches for the same
> instruction is a waste.
>
> If we take the shuffle <-1, 0, 5, 1> as an example (2 V1, 1 V2) -
> lowerVectorShuffle won't to commute this as there are already more V1
> inputs than V2, and won't commute to ensure V1 elements are earlier in the
> shuffle than V2 either, and it is this that is necessary to ensure that the
> unpcks correctly match.
>

Ok, this example helps.


>
> Altering isShuffleMaskEquivalent to support commutation looks relatively
> straightforward (as would supporting duplicate inputs - but that is
> probably unecessary) - would you like me to prepare a patch?
>

It makes the API quite tricky - how do you communicate that the inputs need
to be commuted? You could mutate them, but then this isn't a predicate any
more. I've got some API changes in the same space, let me look at what
alternatives we have here.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150218/a959b88b/attachment.html>


More information about the llvm-commits mailing list