[SLP]Introduce gather cost estimation function.
authorAlexey Bataev <a.bataev@outlook.com>
Wed, 12 Apr 2023 17:36:57 +0000 (10:36 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Thu, 13 Apr 2023 17:16:00 +0000 (10:16 -0700)
commitf82eb7e066f322a231627383fc80522d98ce6181
treecbda659f1b684fe35c42d83cea72bc6c0c4b5b24
parent3d683cb9f1c61f94636ddd7cac0db19ab1339fb1
[SLP]Introduce gather cost estimation function.

Introduced BoUpSLP::ShuffleCostEstimator::gather function as an initial
implementation of the gather/buildvector cost estimation for buildvector
nodes. It will allow to use general codegen infrastructure for better
cost estimation + it improves the cost estimation for the
gathers/buildvectors.

Improved part of D110978.

Differential Revision: https://reviews.llvm.org/D148174
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/AArch64/extractelements-to-shuffle.ll
llvm/test/Transforms/SLPVectorizer/X86/lookahead.ll
llvm/test/Transforms/SLPVectorizer/X86/reduced-gathered-vectorized.ll
llvm/test/Transforms/SLPVectorizer/X86/reduction-logical.ll