[SLP]Improve cost estimation/emission of externally used extractelements.
authorAlexey Bataev <a.bataev@outlook.com>
Fri, 21 May 2021 17:09:12 +0000 (10:09 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Thu, 3 Jun 2021 17:26:59 +0000 (10:26 -0700)
commit8c48d77cdfe5c286dc98b9bf06bd2939d00c4bb4
tree595f0e34856a0717c3bfad49d72062b3f0e0dbd9
parentbb5e1c6dcb78435f8cdcaa9eb1c5af39244df491
[SLP]Improve cost estimation/emission of externally used extractelements.

No need to recalculate the cost of extractelements, just no need to
compensate the cost of all extractelements, need to check before if this
is actually going to be removed at the vectorization. Also, no need to
 generate new extractelement instruction, we may just regenerate the
 original one. It may improve the final vectorization.

Differential Revision: https://reviews.llvm.org/D102933
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/AArch64/PR38339.ll
llvm/test/Transforms/SLPVectorizer/AArch64/vectorize-free-extracts-inserts.ll