[SLP]Fix costs calculations.
authorAlexey Bataev <a.bataev@outlook.com>
Thu, 22 Jul 2021 17:48:36 +0000 (10:48 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Mon, 26 Jul 2021 11:37:22 +0000 (04:37 -0700)
commita053afed49897aa34e08287f91c5255efa4e5131
tree46b9ebefed0bd3d426e8873ddc4b4d4233ca9d96
parent8a8d01d58c14c65d6b1a40bf3335c72f6fcd1388
[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