[llvm] [SLP] Compute a shuffle mask for getGatherCost (PR #85330)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 15 07:43:12 PDT 2024
================
@@ -10516,27 +10516,34 @@ InstructionCost BoUpSLP::getGatherCost(ArrayRef<Value *> VL,
TTI->getVectorInstrCost(Instruction::InsertElement, VecTy, CostKind,
I, Constant::getNullValue(VecTy), V);
};
+ SmallVector<int> ShuffleMask(VL.size(), PoisonMaskElem);
for (unsigned I = 0, E = VL.size(); I < E; ++I) {
Value *V = VL[I];
// No need to shuffle duplicates for constants.
if ((ForPoisonSrc && isConstant(V)) || isa<UndefValue>(V)) {
ShuffledElements.setBit(I);
+ ShuffleMask[I] = I;
----------------
alexey-bataev wrote:
```suggestion
ShuffleMask[I] = isa<PoisonValue>(V) ? PoisonMaskElem : I;
```
https://github.com/llvm/llvm-project/pull/85330
More information about the llvm-commits
mailing list