[llvm] [SLP] NFC. Add assert for ShuffleCostEstimator and ShuffleInstructionBuilder usage. (PR #123708)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 08:51:34 PST 2025


================
@@ -15229,6 +15235,9 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
       SmallVector<int> BVMask(GatheredScalars.size(), PoisonMaskElem);
       TryPackScalars(GatheredScalars, BVMask, /*IsRootPoison=*/true);
       Value *BV = ShuffleBuilder.gather(GatheredScalars, BVMask.size());
+      assert((BVMask.size() == E->Scalars.size() ||
+              BVMask.size() == E->ReuseShuffleIndices.size()) &&
+             "The mask is incompatible with the expected result.");
----------------
alexey-bataev wrote:

May be or may not

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


More information about the llvm-commits mailing list