[llvm] [SLP][NFC] Remove useless code of deleting ExtractElementInst (PR #106697)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 05:27:50 PDT 2024


alexey-bataev wrote:

> The extractelements of buildvector must be the operators of vectorized scalars. Then it will be removed by removeInstructionsAndOperands . Is there any exception?

Some of them, which we can prove they can be vectorized, are vectorized and removed by removeInstructionsAndOperands. But not all combinations of the extractelements can be handled by the SLP vectorizer and transformed into shuffles, some of them remain as extractelement/insertelement sequences. And only adjustExtracts knows which ones of the gathered extractelements can be safely removed as vectorized.

E.g., node <extractelement v1, extractelement v2, extractelement v3, load> will be gathered. First 2 extractelements can be vectorized as shuffle and will be removed by adjustExtracts. The 3rd one, extractelement v3, will currently remains as is and won't be removed.

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


More information about the llvm-commits mailing list