Skip to content

Commit edc42b2

Browse files
committed
[SLP] Migrate away from PointerUnion::get
1 parent 092966a commit edc42b2

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10776,23 +10776,21 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
1077610776
}
1077710777
if (ForExtracts) {
1077810778
// No need to add vectors here, already handled them in adjustExtracts.
10779-
assert(
10780-
InVectors.size() == 1 && isa<const TreeEntry *>(InVectors.front()) &&
10781-
!CommonMask.empty() &&
10782-
all_of(enumerate(CommonMask),
10783-
[&](auto P) {
10784-
Value *Scalar =
10785-
InVectors.front().get<const TreeEntry *>()->getOrdered(
10786-
P.index());
10787-
if (P.value() == PoisonMaskElem)
10788-
return P.value() == Mask[P.index()] ||
10789-
isa<UndefValue>(Scalar);
10790-
if (isa<Constant>(V1))
10791-
return true;
10792-
auto *EI = cast<ExtractElementInst>(Scalar);
10793-
return EI->getVectorOperand() == V1;
10794-
}) &&
10795-
"Expected only tree entry for extractelement vectors.");
10779+
assert(InVectors.size() == 1 && isa<const TreeEntry *>(InVectors[0]) &&
10780+
!CommonMask.empty() &&
10781+
all_of(enumerate(CommonMask),
10782+
[&](auto P) {
10783+
Value *Scalar = cast<const TreeEntry *>(InVectors[0])
10784+
->getOrdered(P.index());
10785+
if (P.value() == PoisonMaskElem)
10786+
return P.value() == Mask[P.index()] ||
10787+
isa<UndefValue>(Scalar);
10788+
if (isa<Constant>(V1))
10789+
return true;
10790+
auto *EI = cast<ExtractElementInst>(Scalar);
10791+
return EI->getVectorOperand() == V1;
10792+
}) &&
10793+
"Expected only tree entry for extractelement vectors.");
1079610794
return;
1079710795
}
1079810796
assert(!InVectors.empty() && !CommonMask.empty() &&

0 commit comments

Comments
 (0)