[SLP]Add detection of shuffled/perfect matching of tree entries.
authorAlexey Bataev <a.bataev@outlook.com>
Wed, 14 Apr 2021 16:44:01 +0000 (09:44 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Mon, 19 Apr 2021 20:29:30 +0000 (13:29 -0700)
commitd6fde913790db898e72e27b51defbc7442f3418a
tree6e2a284917f3527ee000dec83b6857e2d0a17847
parentca8eef7e3da8f750d7c7aa004fe426d1d34787ea
[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.

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