[SLP] Add detection of shuffled/perfect matching of tree entries.
authorAlexey Bataev <a.bataev@outlook.com>
Tue, 20 Apr 2021 12:47:55 +0000 (05:47 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Tue, 20 Apr 2021 13:55:55 +0000 (06:55 -0700)
commitb232771acad6225574a2eaf9f860a0fed7ef0804
treed5f7c547c1a8f34e5846977ae40b2746f05ed4a9
parentf166d0db71bff6f142f290f97389a8f7ab0249dc
[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