[PATCH] D100865: [COST] Improve shuffle kind detection if shuffle mask is provided.
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 21 07:40:38 PDT 2021
ABataev added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:748
+ return TargetTransformInfo::SK_Reverse;
+ if (ShuffleVectorInst::isZeroEltSplatMask(Mask))
+ return TargetTransformInfo::SK_Broadcast;
----------------
CarolineConcatto wrote:
>
> Why are you changing this to broadcast I don't see that happening in SLPVectorizer.cpp.
> Before your implementation
>
> ```
> Kind == TTI::SK_PermuteSingleSrc
> ```
> would call:
>
>
> ```
> return getPermuteShuffleOverhead(cast<FixedVectorType>(Tp));
> ```
>
>
> But now it calls:
>
>
> ```
> return getBroadcastShuffleOverhead(cast<FixedVectorType>(Tp));
> ```
>
> Is that correct?
>
> In my view, some tests would fail because now it has another cost model being called.
>
> Oddly, there is not test failure, despite, in my view and with my knowledge, it would make some tests fail because you are changing the code path for the cost model.
>
> Do you mind adding some tests for that as well?
Yes, there was no such thing in SLP vectorizer, I just extended functionality. Will try to add the tests for it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100865/new/
https://reviews.llvm.org/D100865
More information about the llvm-commits
mailing list