patch: make instcombine remove shuffles by reordering vector elements

David Tweed David.Tweed at arm.com
Wed May 8 03:53:02 PDT 2013


| 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?

| 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.

Note that there's a specialisation of groups referred to as monoids (http://en.wikipedia.org/wiki/Monoid ) which essentially deal with transformations which are non-invertible. So there is a branch of algebra that studies such things. However, I'm not in any way expert on monoids and their algorithms. (To the extent I've thought about variants of groups in compiler design, I've been interested in how groupoids might be able to represent some things.)

Cheers,
Dave


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130508/72034392/attachment.html>


More information about the llvm-commits mailing list