[llvm] [SLP]Add cost estimation for gather node reshuffling (PR #115201)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 08:07:47 PST 2024


================
@@ -991,17 +991,34 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
       return Kind;
     int NumSrcElts = Ty->getElementCount().getKnownMinValue();
     switch (Kind) {
-    case TTI::SK_PermuteSingleSrc:
+    case TTI::SK_PermuteSingleSrc: {
       if (ShuffleVectorInst::isReverseMask(Mask, NumSrcElts))
         return TTI::SK_Reverse;
       if (ShuffleVectorInst::isZeroEltSplatMask(Mask, NumSrcElts))
         return TTI::SK_Broadcast;
+      // Check that the broadcast index meets at least twice.
+      bool IsCompared = false;
----------------
preames wrote:

Would be easier to read if you pulled out a helper function for this, and left a comment about why this is different than isZeroEltSplatMask

https://github.com/llvm/llvm-project/pull/115201


More information about the llvm-commits mailing list