[SLP]Fix costs calculations.
authorAlexey Bataev <a.bataev@outlook.com>
Mon, 26 Jul 2021 12:43:53 +0000 (05:43 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Mon, 26 Jul 2021 14:14:03 +0000 (07:14 -0700)
commit6ca48efcf6e16adfcf33688d86de7bd2bb75a49a
tree72cc6e9bdea9e399840f546bff4cb948596c25f6
parent81600160b3f926746d02c52003d81180941fe9d0
[SLP]Fix costs calculations.

Need to fix several cost-related problems. The final type may be defined
incorrectly because of to early definition (we may end up with the wider
type), the CommonCost should not be redefined in ExtractElements
cost related calculations and the shuffle of the final insertelements
vectors should be calculated as a cost of single vector permutations
+ costs of two vector permutations for other n-1 incoming vectors.

Differential Revision: https://reviews.llvm.org/D106578
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/vec_list_bias-inseltpoison.ll
llvm/test/Transforms/SLPVectorizer/X86/vec_list_bias.ll