[SLP]Outline and fix code for finding common insertelement vectors.
authorAlexey Bataev <a.bataev@outlook.com>
Wed, 1 Dec 2021 18:01:56 +0000 (10:01 -0800)
committerAlexey Bataev <a.bataev@outlook.com>
Thu, 2 Dec 2021 17:18:25 +0000 (09:18 -0800)
commit8ceccbd321319434450717ac1917cdca174ff6eb
tree205ffc6a8437e07af1a5505d61dc05a2ea5baac6
parentb8f1ccb0acf8dccdd3fb706465ec958763987bee
[SLP]Outline and fix code for finding common insertelement vectors.

Need to outline the code for finding common vectors in insertelement
instructions into a separate function for future patches. It also
improves the process by adding some extra checks for early exit and
fixes a bug where it always finds the match because of erroneous compare
of the same values.

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