[llvm] [SLP] Pessimistically handle unknown vector entries in SLP vectorizer (PR #75438)

Maurice Heumann via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 04:18:26 PST 2023


momo5502 wrote:

> Ok, let's fix it this way for now, later need to teach getInsertIndex to separate representation for undef/runtime indices

Alright. Thank you for your review.

Also, while analyzing the issue. I figured there were cases where SLP inserts seemingly redundant shuffles. For example here:

![image](https://github.com/llvm/llvm-project/assets/4027748/f55893a8-a125-463e-9355-57ed33155600)

`%122` on the left is replaced by 3 shuffles. The last two shuffles expand (`%128`) and merge (`%129`) the vector, however the first shuffle (`%127`) is not being referenced anywhere else in the remaining code (that I can unfortunately not screenshot).

While the redundant shuffle will eventually be removed later by DCE, I am still curious, is there a known reason this happens?

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


More information about the llvm-commits mailing list