[SLP] Add detection of shuffled/perfect matching of tree entries.
authorAlexey Bataev <a.bataev@outlook.com>
Tue, 20 Apr 2021 14:27:32 +0000 (07:27 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Tue, 20 Apr 2021 14:46:49 +0000 (07:46 -0700)
commitdaf6e18c55c2ac56bbf0f9de233fb2a1150ee331
tree571bca6d6898e8a574260327fefe05a80d7c97ee
parent7b7df8e85eec445389e4b07915f16aa18332719d
[SLP] Add detection of shuffled/perfect matching of tree entries.

SLP supports perfect diamond matching for the vectorized tree entries
but do not support it for gathered entries and does not support
non-perfect (shuffled) matching with 1 or 2 tree entries. Patch adds
support for this matching to improve cost of the vectorized tree.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D100495
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/AArch64/gather-cost.ll
llvm/test/Transforms/SLPVectorizer/X86/matched-shuffled-entries.ll