[SLP]Do not emit many extractelements, reuse the single one emitted.
authorAlexey Bataev <a.bataev@outlook.com>
Thu, 22 Dec 2022 20:07:44 +0000 (12:07 -0800)
committerAlexey Bataev <a.bataev@outlook.com>
Fri, 30 Dec 2022 14:38:06 +0000 (06:38 -0800)
commit5dccea5a68fb5181ab88ce6faac4668934f35cd7
treea1e9bf6ebb872d550c1f7116cb6d60aa936bbc72
parent6c232db2ae933ad8f53cc39c8387fdceef7e8542
[SLP]Do not emit many extractelements, reuse the single one emitted.

We do not need to emit many extractelements for each particular use, we
can reuse the only one, just need to adjust it to make it dominate on
all uses.

Differential Revision: https://reviews.llvm.org/D140580
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/pr35497.ll