patch: make instcombine remove shuffles by reordering vector elements

Duncan Sands duncan.sands at gmail.com
Sun May 5 07:35:53 PDT 2013


Hi Hal,

> Actually, I think that it works the other way: It runs through all combinations of the input permutation instructions (so the table generator is just solving all of the forward problems, not the inverse problem, and it stores the lowest-cost result for each computed output).
>
> On PPC, however, the situation seems slightly more friendly than on x86 because we still do have a general-purpose permutation instruction, it is just faster (and lowers register pressure) to use an alternative sequence.
>
>> Maybe it is possible to solve the optimization
>> problem, or
>> get a near-to-optimal solution, on the fly with a sufficiently clever
>> algorithm.
>
> It seems like it should be possible. If we restrict the problem so that multiple simultaneous intermediate results are not allowed, then this certainly seems like a group-theory question. Do you know anyone who is a computational group theory expert?

I still have an office in the Orsay mathematics department, a leftover from a
previous life!  I can ask some of the people there next time I drop by.

Ciao, Duncan.



More information about the llvm-commits mailing list