Skip to content

Commit 2e4cc9a

Browse files
committed
Revert "[SLP]Allow masked gathers only if allowed by target."
This reverts commit b5f6476 to fix a compiler crash revealed by buildbots.
1 parent b5f6476 commit 2e4cc9a

File tree

4 files changed

+603
-326
lines changed

4 files changed

+603
-326
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3921,24 +3921,9 @@ InstructionCost BoUpSLP::getEntryCost(TreeEntry *E) {
39213921
CostKind, VL0);
39223922
} else {
39233923
assert(E->State == TreeEntry::ScatterVectorize && "Unknown EntryState");
3924-
if (TTI->isLegalMaskedGather(VecTy, alignment)) {
3925-
VecLdCost = TTI->getGatherScatterOpCost(
3926-
Instruction::Load, VecTy,
3927-
cast<LoadInst>(VL0)->getPointerOperand(),
3928-
/*VariableMask=*/false, alignment, CostKind, VL0);
3929-
} else {
3930-
// Lower just to a gather if masked gather is not legal. Also,
3931-
// compensate the cost of next entry for pointers.
3932-
VecLdCost =
3933-
getGatherCost(VL) -
3934-
getEntryCost(
3935-
find_if(VectorizableTree,
3936-
[E](const std::unique_ptr<TreeEntry> &TE) {
3937-
return TE->UserTreeIndices.size() == 1 &&
3938-
TE->UserTreeIndices.front().UserTE == E;
3939-
})
3940-
->get());
3941-
}
3924+
VecLdCost = TTI->getGatherScatterOpCost(
3925+
Instruction::Load, VecTy, cast<LoadInst>(VL0)->getPointerOperand(),
3926+
/*VariableMask=*/false, alignment, CostKind, VL0);
39423927
}
39433928
if (!NeedToShuffleReuses && !E->ReorderIndices.empty()) {
39443929
SmallVector<int> NewMask;

0 commit comments

Comments
 (0)