[SLP]Fix the cost for the extractelements, used in several nodes.
authorAlexey Bataev <a.bataev@outlook.com>
Thu, 20 Apr 2023 14:11:48 +0000 (07:11 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Fri, 21 Apr 2023 16:05:03 +0000 (09:05 -0700)
commit851a12138a765b43d86bb4729e418ee745375592
tree409b6ed72c7de43fbdcee8ad6afad963b7660dc3
parentd003c01c302978a7397b3caeb06c6ca0e5f1b6da
[SLP]Fix the cost for the extractelements, used in several nodes.

Currently the compiler calculates the compensation cost for the
extractelements, removed during vectorization. But if the extractelement
instruction is used in several nodes, we can calculate the compensation
for them several times.

Differential Revision: https://reviews.llvm.org/D148806
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/reused-extractelements.ll