[PATCH] D14261: [X86][SSE] Recursive search for zeroable shuffle elements

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 15 08:28:15 PST 2015


RKSimon added a comment.

In http://reviews.llvm.org/D14261#289720, @chandlerc wrote:

> I'm really not convinced this is the correct approach.


Is it mainly the recursion that is concerning you? There is more that we could do at the DAGCombiner or X86 level to merge shuffles, but it would still be recursion. Other targets have shuffle instructions that set elements to constants (zero and allbits being the most common) as well as as input permutations, but I don't see much that makes use of this at all.

I've been trying to think of ways to canonicalize shuffles with zeros/constants inputs to reduce this but can't think of anything that would really help.

> Instead, I think we should combine SHUFFLE_VECTOR nodes into a single node so that we don't need this kind of recursive logic. If that doesn't work for some reason, I think that needs to be pretty clearly explained.


The X86 shuffle combining could do some of this, but it would still be recursive and it would be repeating a lot of what is done at lowering already.

insertps is a curious instruction in that it really takes 3 inputs (well, 2 inputs + zero), which makes combining rather tricky with our existing methods - as another approach I could disable recursion in computeZeroableShuffleElements by default and just have the insertps lowering use it?


Repository:
  rL LLVM

http://reviews.llvm.org/D14261





More information about the llvm-commits mailing list