patch: make instcombine remove shuffles by reordering vector elements
Hal Finkel
hfinkel at anl.gov
Sun May 5 23:41:18 PDT 2013
----- Original Message -----
> From: "Owen Anderson" <resistor at mac.com>
> To: "Sean Silva" <silvas at purdue.edu>
> Cc: "Hal Finkel" <hfinkel at anl.gov>, llvm-commits at cs.uiuc.edu
> Sent: Monday, May 6, 2013 12:35:10 AM
> Subject: Re: patch: make instcombine remove shuffles by reordering vector elements
>
>
> 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).
Ah, good point. They're really monoids in general. FWIW, a well-motivated solution to the subproblem of invertible shuffles might be useful regardless.
> 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.
I don't think this affects the lowering problem. Does it?
>
> 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.
I think this is also not an issue, as such, but it changes the definition of the problem.
-Hal
>
> --Owen
>
>
More information about the llvm-commits
mailing list