[llvm] [SLP] Compute a shuffle mask for getGatherCost (PR #85330)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 16:19:12 PDT 2024


================
@@ -10526,6 +10527,7 @@ InstructionCost BoUpSLP::getGatherCost(ArrayRef<Value *> VL,
     if (!UniqueElements.insert(V).second) {
       DuplicateNonConst = true;
       ShuffledElements.setBit(I);
+      ShuffleMask[I] = I;
----------------
alexey-bataev wrote:

This does not look correct. You generated identity mask here, which is not. Need to record the position of the first unique value and then use it here as index.

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


More information about the llvm-commits mailing list