[llvm] [VectorCombine] foldShuffleOfShuffles - fold shuffle(shuffle(x,y),poison) length changing masks (PR #144690)

David Green via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 21 04:47:21 PDT 2025


davemgreen wrote:

It is about the FIXME in https://github.com/llvm/llvm-project/blob/77941eba7f01fc6576b3e060a3fb9cad1a64f9ea/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h#L1585, (added with that patch), that is assuming vectors will be widened not promoted (the default for small integer types), and the target not having a way to override it. Those assumptions are all over the SLP vectorizer too, but that is more difficult to follow and update. I was hoping to try and move the code out of the generic cost model into targets that did perform widening and let them produce higher/different costs if needed. I have seen cases recently of something like a v2i8 vector with mask [0,2] be widened to [0,2,u,u,u,u,u,u], that looking like a zip but the actual codegen not being anything like it. Let me know what you think about it, the first time I tried it I didn't get very far.

https://github.com/llvm/llvm-project/pull/144690


More information about the llvm-commits mailing list