[llvm] edc42b2 - [SLP] Migrate away from PointerUnion::get
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 27 21:01:14 PST 2024
Author: Fangrui Song
Date: 2024-12-27T21:01:09-08:00
New Revision: edc42b2dc18c1bf413fc393eeb05abd6076d8bbe
URL: https://github.com/llvm/llvm-project/commit/edc42b2dc18c1bf413fc393eeb05abd6076d8bbe
DIFF: https://github.com/llvm/llvm-project/commit/edc42b2dc18c1bf413fc393eeb05abd6076d8bbe.diff
LOG: [SLP] Migrate away from PointerUnion::get
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 7f4c3d44b0ec4f..f52ddfda5e64c7 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -10776,23 +10776,21 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
}
if (ForExtracts) {
// No need to add vectors here, already handled them in adjustExtracts.
- assert(
- InVectors.size() == 1 && isa<const TreeEntry *>(InVectors.front()) &&
- !CommonMask.empty() &&
- all_of(enumerate(CommonMask),
- [&](auto P) {
- Value *Scalar =
- InVectors.front().get<const TreeEntry *>()->getOrdered(
- P.index());
- if (P.value() == PoisonMaskElem)
- return P.value() == Mask[P.index()] ||
- isa<UndefValue>(Scalar);
- if (isa<Constant>(V1))
- return true;
- auto *EI = cast<ExtractElementInst>(Scalar);
- return EI->getVectorOperand() == V1;
- }) &&
- "Expected only tree entry for extractelement vectors.");
+ assert(InVectors.size() == 1 && isa<const TreeEntry *>(InVectors[0]) &&
+ !CommonMask.empty() &&
+ all_of(enumerate(CommonMask),
+ [&](auto P) {
+ Value *Scalar = cast<const TreeEntry *>(InVectors[0])
+ ->getOrdered(P.index());
+ if (P.value() == PoisonMaskElem)
+ return P.value() == Mask[P.index()] ||
+ isa<UndefValue>(Scalar);
+ if (isa<Constant>(V1))
+ return true;
+ auto *EI = cast<ExtractElementInst>(Scalar);
+ return EI->getVectorOperand() == V1;
+ }) &&
+ "Expected only tree entry for extractelement vectors.");
return;
}
assert(!InVectors.empty() && !CommonMask.empty() &&
More information about the llvm-commits
mailing list