<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 18, 2015 at 2:17 PM, Simon Pilgrim <span dir="ltr"><<a href="mailto:llvm-dev@redking.me.uk" target="_blank">llvm-dev@redking.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":45p" class="a3s" style="overflow:hidden">I agree that adding multiple shuffle pattern matches for the same instruction is a waste.<br>
<br>
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.<br></div></blockquote><div><br></div><div>Ok, this example helps.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":45p" class="a3s" style="overflow:hidden">
<br>
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?</div></blockquote></div><br></div><div class="gmail_extra">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.</div></div>