Skip to content

Commit 5a116f8

Browse files
[Vectorize] Migrate away from PointerUnion::dyn_cast (NFC) (llvm#125159)
Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa<T>, cast<T> and the llvm::dyn_cast<T> Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect InVectors.front() and P to be nonnull.
1 parent 9268494 commit 5a116f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10354,7 +10354,7 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
1035410354
SameNodesEstimated = false;
1035510355
if (!E2 && InVectors.size() == 1) {
1035610356
unsigned VF = E1.getVectorFactor();
10357-
if (Value *V1 = InVectors.front().dyn_cast<Value *>()) {
10357+
if (Value *V1 = dyn_cast<Value *>(InVectors.front())) {
1035810358
VF = std::max(VF,
1035910359
cast<FixedVectorType>(V1->getType())->getNumElements());
1036010360
} else {
@@ -10370,7 +10370,7 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
1037010370
auto P = InVectors.front();
1037110371
Cost += createShuffle(&E1, E2, Mask);
1037210372
unsigned VF = Mask.size();
10373-
if (Value *V1 = P.dyn_cast<Value *>()) {
10373+
if (Value *V1 = dyn_cast<Value *>(P)) {
1037410374
VF = std::max(VF,
1037510375
getNumElements(V1->getType()));
1037610376
} else {

0 commit comments

Comments
 (0)