[PATCH] D115750: [SLP]Further improvement of the cost model for scalars used in buildvectors.
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 14 12:08:20 PST 2021
ABataev created this revision.
ABataev added reviewers: RKSimon, anton-afanasyev, dtemirbulatov.
Herald added a subscriber: hiraditya.
ABataev requested review of this revision.
Herald added a project: LLVM.
Further improvement of the cost model for the scalars used in
buildvectors sequences. The main functionality is outlined into
a separate function.
The cost is calculated in the following way:
1. If the Base vector is not undef vector, resizing the very first mask to
have common VF and perform action for 2 input vectors (including non-undef
Base). Other shuffle masks are combined with the resulting after the 1 stage and processed as a shuffle of 2 elements.
2. If the Base is undef vector and have only 1 shuffle mask, perform the
action only for 1 vector with the given mask, if it is not the identity
mask.
3. If > 2 masks are used, perform serie of shuffle actions for 2 vectors,
combing the masks properly between the steps.
The original implementation misses the very first analysis for the Base
vector, so the cost might too optimistic in some cases. But it improves
the cost for the insertelements which are part of the current SLP graph.
Part of D107966 <https://reviews.llvm.org/D107966>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D115750
Files:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/crash_scheduling-inseltpoison.ll
llvm/test/Transforms/SLPVectorizer/X86/crash_scheduling.ll
llvm/test/Transforms/SLPVectorizer/X86/extracts-with-undefs.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115750.394339.patch
Type: text/x-patch
Size: 26628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211214/5bb7e14a/attachment.bin>
More information about the llvm-commits
mailing list