[llvm] [SLP][REVEC] Make getAltInstrMask and getGatherCost vectorize vector instructions. (PR #99461)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 04:46:30 PDT 2024


================
@@ -11375,7 +11379,8 @@ InstructionCost BoUpSLP::getGatherCost(ArrayRef<Value *> VL, bool ForPoisonSrc,
     Value *V = VL[I];
     // No need to shuffle duplicates for constants.
     if ((ForPoisonSrc && isConstant(V)) || isa<UndefValue>(V)) {
-      ShuffledElements.setBit(I);
+      for (unsigned J = 0; J != ScalarTyNumElements; ++J)
+        ShuffledElements.setBit(I * ScalarTyNumElements + J);
----------------
alexey-bataev wrote:

```suggestion
      ShuffledElements.setBit(I * ScalarTyNumElements, I * ScalarTyNumElements + ScalarTyNumElements);
```


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


More information about the llvm-commits mailing list