[llvm] [SLP][NFC] Remove useless code of deleting ExtractElementInst (PR #106697)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 30 06:04:10 PDT 2024
tcwzxx 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 remain as is and won't be removed.
Thanks for the explanation. You are right.
https://github.com/llvm/llvm-project/pull/106697
More information about the llvm-commits
mailing list