patch: make instcombine remove shuffles by reordering vector elements

Anton Korobeynikov anton at korobeynikov.info
Sun May 5 01:22:20 PDT 2013


>> We lower x86
>> shuffles with 1000 lines of c++ code.
>
> Maybe that's not so bad ;) The PPC has a whole perfect-shuffle generation framework to handle these kinds of things for Altivec. Have you ever looked at PPCPerfectShuffle.h and utils/PerfectShuffle/PerfectShuffle.cpp?
Same on ARM. But everything is only for 4-element shuffle. Doing same
for 8 element shuffles looks like an impractical task (both in time
and memory requirement for shuffle table).

We can "cheat" with some clever "8 el shuffle to 4 el shuffle"
lowering pass, but I'm not aware of any.

And on x86 we have much wider regs...

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-commits mailing list