patch: make instcombine remove shuffles by reordering vector elements

Owen Anderson resistor at mac.com
Sun May 5 22:35:10 PDT 2013


On May 5, 2013, at 9:43 PM, Sean Silva <silvas at purdue.edu> wrote:

> Since shuffles that repeat indices are permitted (e.g. [0,1,2,3] -> [1,1,2,3]), some shuffles don't have inverses, so it's unlikely that the problem will be very amenable to group theoretic inquiry (unless there is some clever way to represent the operations that isn't simply how they rearrange the inputs). Also the fact that e.g. the AVX instruction PSHUFB can put 0's into the result without being in the source seems like a difficult obstacle to formalize group theoretically.

Another tricky issue, which contributes to the intractability of PerfectShuffle for large vector widths, if the presence of don't-care lanes.  If the contents of a lane is undefined by the shuffle, that significantly frees up the pattern matcher to find an optimal sequence, but it also makes it even less of a match to group theoretic solution.

--Owen





More information about the llvm-commits mailing list